new is_signing and is_sending configuration options

This commit is contained in:
The MMGen Project 2026-09-10 02:13:24 +00:00
commit b07f41960a
Signed by: mmgen
GPG key ID: 3F8B1861E32B7DA2
3 changed files with 10 additions and 6 deletions

View file

@ -626,6 +626,11 @@ class Config(Lockable):
if hasattr(self, 'bch_cashaddr') and not hasattr(self, 'cashaddr'):
self.cashaddr = self.bch_cashaddr
if 'sign' in gc.prog_name:
self.is_signing = True
elif 'send' in gc.prog_name and not (hasattr(self, 'status') or hasattr(self, 'receipt')):
self.is_sending = True
self._lock()
if need_proto:

View file

@ -1 +1 @@
16.3.0dev3
16.3.0dev4

View file

@ -12,7 +12,6 @@
tx.completed: completed transaction class
"""
from ..cfg import gc
from ..util import msg, ymsg, die
from .base import Base
@ -108,9 +107,9 @@ class Completed(Base):
die('TxFileVersionError', errmsg)
def legacy_fmt_chk(self, desc):
if 'sign' in gc.prog_name:
if self.cfg.is_signing:
a, b = ('sign', 'Has your online installation been compromised?')
elif 'send' in gc.prog_name:
elif self.cfg.is_sending:
a, b = ('send', 'Is your offline installation out of date?')
elif not self.cfg.allow_legacy_tx_files:
a, b = ('operate on', 'Operation forbidden by ‘allow_legacy_tx_files false’')
@ -120,10 +119,10 @@ class Completed(Base):
self.die_on_version_error(fs.format(a, b))
def txfile_version_chk(self, f_ver, s_ver):
if 'sign' in gc.prog_name:
if self.cfg.is_signing:
a = 'sign'
b = 'Is your {} installation out of date?'.format('offline' if f_ver > s_ver else 'online')
elif 'send' in gc.prog_name:
elif self.cfg.is_sending:
a = 'send'
b = 'Is your {} installation out of date?'.format('offline' if f_ver < s_ver else 'online')
elif self.cfg.forbid_version_mismatched_tx_files: