From 8867e747af50701a43faa4eb22a3c2b2390cfab1 Mon Sep 17 00:00:00 2001 From: The MMGen Project Date: Thu, 4 Jun 2026 10:41:42 +0000 Subject: [PATCH] CoinProtocol.Base: add default `coin_amt` attr --- mmgen/protocol.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/mmgen/protocol.py b/mmgen/protocol.py index 99c3a91b..ad130a87 100755 --- a/mmgen/protocol.py +++ b/mmgen/protocol.py @@ -58,6 +58,8 @@ class CoinProtocol(MMGenObject): is_vm = False is_evm = False has_usr_fee = True + coin_amt = None + max_tx_fee = None rpc_type = 'local' networks = ('mainnet', 'testnet', 'regtest') decimal_prec = 28 @@ -110,15 +112,12 @@ class CoinProtocol(MMGenObject): from .util2 import get_keccak self.keccak_256 = get_keccak(cfg) - if need_amt: + if need_amt and self.coin_amt: 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 hasattr(self, 'max_tx_fee') else None + self.max_tx_fee = self.coin_amt(str(self.max_tx_fee)) if self.max_tx_fee else None getcontext().prec = self.decimal_prec - else: - self.coin_amt = None - self.max_tx_fee = None self.set_cfg_opts()