protocol: set type of max_tx_fee after it’s set from cfg file

This commit is contained in:
The MMGen Project 2026-09-29 09:23:31 +00:00
commit dc7f256270
Signed by: mmgen
GPG key ID: 3F8B1861E32B7DA2
2 changed files with 5 additions and 4 deletions

View file

@ -113,15 +113,15 @@ class CoinProtocol(MMGenObject):
from .util2 import get_keccak
self.keccak_256 = get_keccak(cfg)
if need_amt and self.coin_amt:
self.set_cfg_opts() # a) could reset max_tx_fee
if need_amt and self.coin_amt: # b) set type of max_tx_fee _after_ possible reset
from . import amt
from decimal import getcontext
self.coin_amt = getattr(amt, self.coin_amt)
self.max_tx_fee = self.coin_amt(str(self.max_tx_fee)) if self.max_tx_fee else None
getcontext().prec = self.decimal_prec
self.set_cfg_opts()
def set_cfg_opts(self):
pass

View file

@ -148,7 +148,8 @@ class CmdGroupMgr:
return cls
def gm_init_group(self, cfg, trunner, gname, sg_name, spawn_prog):
write_to_cfgfile([])
if not (cfg.resuming or cfg.skipping_deps):
write_to_cfgfile([])
cls = self.create_group(gname, sg_name, **self.cmd_groups[gname].params)
cls.group_name = gname
return cls(cfg, trunner, cfgs, spawn_prog)