ledger: support hiding outputs on 'receive' branch
so if change is on the 'receive' branch, user won't be prompted to confirm it
This commit is contained in:
@@ -15,6 +15,7 @@ from electrum.wallet import Standard_Wallet
|
||||
from electrum.base_wizard import ScriptTypeNotSupported
|
||||
|
||||
from ..hw_wallet import HW_PluginBase
|
||||
from ..hw_wallet.plugin import is_any_tx_output_on_change_branch
|
||||
|
||||
|
||||
# TREZOR initialization methods
|
||||
@@ -393,18 +394,9 @@ class KeepKeyPlugin(HW_PluginBase):
|
||||
txoutputtype.address = address
|
||||
return txoutputtype
|
||||
|
||||
def is_any_output_on_change_branch():
|
||||
for _type, address, amount in tx.outputs():
|
||||
info = tx.output_info.get(address)
|
||||
if info is not None:
|
||||
index, xpubs, m = info
|
||||
if index[0] == 1:
|
||||
return True
|
||||
return False
|
||||
|
||||
outputs = []
|
||||
has_change = False
|
||||
any_output_on_change_branch = is_any_output_on_change_branch()
|
||||
any_output_on_change_branch = is_any_tx_output_on_change_branch(tx)
|
||||
|
||||
for _type, address, amount in tx.outputs():
|
||||
use_create_by_derivation = False
|
||||
|
||||
Reference in New Issue
Block a user