diff --git a/electrum/coinchooser.py b/electrum/coinchooser.py index 4154249fd..9076c2aa8 100644 --- a/electrum/coinchooser.py +++ b/electrum/coinchooser.py @@ -103,10 +103,9 @@ def strip_unneeded(bkts: List[Bucket], sufficient_funds) -> List[Bucket]: class CoinChooserBase(Logger): - enable_output_value_rounding = False - - def __init__(self): + def __init__(self, *, enable_output_value_rounding: bool): Logger.__init__(self) + self.enable_output_value_rounding = enable_output_value_rounding def keys(self, coins: Sequence[PartialTxInput]) -> Sequence[str]: raise NotImplementedError @@ -485,6 +484,7 @@ def get_name(config): def get_coin_chooser(config): klass = COIN_CHOOSERS[get_name(config)] - coinchooser = klass() - coinchooser.enable_output_value_rounding = config.get('coin_chooser_output_rounding', False) + coinchooser = klass( + enable_output_value_rounding=config.get('coin_chooser_output_rounding', False), + ) return coinchooser