Skip to content

Commit

Permalink
show address on trezor for multisig
Browse files Browse the repository at this point in the history
  • Loading branch information
farmerwampum committed Feb 2, 2018
1 parent e5f239d commit f315cb9
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 3 deletions.
18 changes: 17 additions & 1 deletion plugins/trezor/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,23 @@ def show_address(self, wallet, address):
script_type = self.types.InputScriptType.SPENDP2SHWITNESS
else:
script_type = self.types.InputScriptType.SPENDADDRESS
client.get_address(self.get_coin_name(), address_n, True, script_type=script_type)
xpubs = wallet.get_master_public_keys()
if len(xpubs) == 1:
client.get_address(self.get_coin_name(), address_n, True, script_type=script_type)
else:
def f(xpub):
node = self.ckd_public.deserialize(xpub)
return self.types.HDNodePathType(node=node, address_n=[change, index])
pubkeys = wallet.get_public_keys(address)
# sort xpubs using the order of pubkeys
sorted_pubkeys, sorted_xpubs = zip(*sorted(zip(pubkeys, xpubs)))
pubkeys = list(map(f, sorted_xpubs))
multisig = self.types.MultisigRedeemScriptType(
pubkeys=pubkeys,
signatures=[b''] * wallet.n,
m=wallet.m,
)
client.get_address(self.get_coin_name(), address_n, True, multisig=multisig)

def tx_inputs(self, tx, for_sig=False, script_gen=SCRIPT_GEN_LEGACY):
inputs = []
Expand Down
2 changes: 0 additions & 2 deletions plugins/trezor/qt_generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,8 +188,6 @@ def create_handler(self, window):

@hook
def receive_menu(self, menu, addrs, wallet):
if type(wallet) is not Standard_Wallet:
return
keystore = wallet.get_keystore()
if type(keystore) == self.keystore_class and len(addrs) == 1:
def show_address():
Expand Down

0 comments on commit f315cb9

Please sign in to comment.