electrum

Electrum Bitcoin wallet
git clone https://git.parazyd.org/electrum
Log | Files | Refs | Submodules

commit 5958fa8b2daf3e75a9fbe392e8f1d0147e7b9d83
parent d1f860ccf39229121433bb125e5c12770c206270
Author: SomberNight <somber.night@protonmail.com>
Date:   Wed,  3 Jun 2020 18:14:05 +0200

coinchooser: small clean-up re enable_output_value_rounding

Diffstat:
Melectrum/coinchooser.py | 10+++++-----
1 file changed, 5 insertions(+), 5 deletions(-)

diff --git 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