1
0

wallet.add_hw_info: also store "is_change" in output_info

as it seems every consumer wants to know this and has its own hacks to
figure it out
This commit is contained in:
SomberNight
2019-09-03 14:34:10 +02:00
parent ac329797e0
commit ab76a1fe5b
8 changed files with 22 additions and 21 deletions

View File

@@ -407,7 +407,7 @@ class KeepKeyPlugin(HW_PluginBase):
return inputs
def tx_outputs(self, derivation, tx):
def tx_outputs(self, derivation, tx: Transaction):
def create_output_by_derivation():
script_type = self.get_keepkey_output_script_type(info.script_type)
@@ -454,10 +454,9 @@ class KeepKeyPlugin(HW_PluginBase):
info = tx.output_info.get(address)
if info is not None and not has_change:
index, xpubs, m = info.address_index, info.sorted_xpubs, info.num_sig
on_change_branch = index[0] == 1
# prioritise hiding outputs on the 'change' branch from user
# because no more than one change address allowed
if on_change_branch == any_output_on_change_branch:
if info.is_change == any_output_on_change_branch:
use_create_by_derivation = True
has_change = True