Hardware wallets: limit change outputs to 1
This commit is contained in:
parent
b752e91dae
commit
efa1efedca
|
@ -151,6 +151,9 @@ class Abstract_Wallet(PrintError):
|
||||||
Wallet classes are created to handle various address generation methods.
|
Wallet classes are created to handle various address generation methods.
|
||||||
Completion states (watching-only, single account, no seed, etc) are handled inside classes.
|
Completion states (watching-only, single account, no seed, etc) are handled inside classes.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
max_change_outputs = 3
|
||||||
|
|
||||||
def __init__(self, storage):
|
def __init__(self, storage):
|
||||||
self.storage = storage
|
self.storage = storage
|
||||||
self.network = None
|
self.network = None
|
||||||
|
@ -966,7 +969,7 @@ class Abstract_Wallet(PrintError):
|
||||||
dust_threshold = 182 * 3 * self.relayfee() / 1000
|
dust_threshold = 182 * 3 * self.relayfee() / 1000
|
||||||
|
|
||||||
# Let the coin chooser select the coins to spend
|
# Let the coin chooser select the coins to spend
|
||||||
max_change = 3 if self.multiple_change else 1
|
max_change = self.max_change_outputs if self.multiple_change else 1
|
||||||
coin_chooser = self.coin_chooser(config)
|
coin_chooser = self.coin_chooser(config)
|
||||||
tx = coin_chooser.make_tx(coins, outputs, change_addrs[:max_change],
|
tx = coin_chooser.make_tx(coins, outputs, change_addrs[:max_change],
|
||||||
fee_estimator, dust_threshold)
|
fee_estimator, dust_threshold)
|
||||||
|
|
|
@ -33,6 +33,7 @@ class BTChipWallet(BIP44_Wallet):
|
||||||
wallet_type = 'btchip'
|
wallet_type = 'btchip'
|
||||||
device = 'Ledger'
|
device = 'Ledger'
|
||||||
restore_wallet_class = BIP44_Wallet
|
restore_wallet_class = BIP44_Wallet
|
||||||
|
max_change_outputs = 1
|
||||||
|
|
||||||
def __init__(self, storage):
|
def __init__(self, storage):
|
||||||
BIP44_Wallet.__init__(self, storage)
|
BIP44_Wallet.__init__(self, storage)
|
||||||
|
|
|
@ -36,6 +36,7 @@ class TrezorCompatibleWallet(BIP44_Wallet):
|
||||||
# - wallet_type
|
# - wallet_type
|
||||||
|
|
||||||
restore_wallet_class = BIP44_Wallet
|
restore_wallet_class = BIP44_Wallet
|
||||||
|
max_change_outputs = 1
|
||||||
|
|
||||||
def __init__(self, storage):
|
def __init__(self, storage):
|
||||||
BIP44_Wallet.__init__(self, storage)
|
BIP44_Wallet.__init__(self, storage)
|
||||||
|
|
Loading…
Reference in New Issue