Merge pull request #1434 from keepkey/master
made sure to check if x_pubkey is valid xpub before parsing it
This commit is contained in:
commit
127f5f8804
|
@ -283,13 +283,14 @@ class Plugin(BasePlugin):
|
||||||
)
|
)
|
||||||
# find which key is mine
|
# find which key is mine
|
||||||
for x_pubkey in x_pubkeys:
|
for x_pubkey in x_pubkeys:
|
||||||
xpub, s = BIP32_Account.parse_xpubkey(x_pubkey)
|
if is_extended_pubkey(x_pubkey):
|
||||||
if xpub in self.xpub_path:
|
xpub, s = BIP32_Account.parse_xpubkey(x_pubkey)
|
||||||
xpub_n = self.get_client().expand_path(self.xpub_path[xpub])
|
if xpub in self.xpub_path:
|
||||||
txinputtype.address_n.extend(xpub_n + s)
|
xpub_n = self.get_client().expand_path(self.xpub_path[xpub])
|
||||||
break
|
txinputtype.address_n.extend(xpub_n + s)
|
||||||
else:
|
break
|
||||||
raise
|
else:
|
||||||
|
raise
|
||||||
|
|
||||||
prev_hash = unhexlify(txin['prevout_hash'])
|
prev_hash = unhexlify(txin['prevout_hash'])
|
||||||
prev_index = txin['prevout_n']
|
prev_index = txin['prevout_n']
|
||||||
|
|
|
@ -282,13 +282,14 @@ class Plugin(BasePlugin):
|
||||||
)
|
)
|
||||||
# find which key is mine
|
# find which key is mine
|
||||||
for x_pubkey in x_pubkeys:
|
for x_pubkey in x_pubkeys:
|
||||||
xpub, s = BIP32_Account.parse_xpubkey(x_pubkey)
|
if is_extended_pubkey(x_pubkey):
|
||||||
if xpub in self.xpub_path:
|
xpub, s = BIP32_Account.parse_xpubkey(x_pubkey)
|
||||||
xpub_n = self.get_client().expand_path(self.xpub_path[xpub])
|
if xpub in self.xpub_path:
|
||||||
txinputtype.address_n.extend(xpub_n + s)
|
xpub_n = self.get_client().expand_path(self.xpub_path[xpub])
|
||||||
break
|
txinputtype.address_n.extend(xpub_n + s)
|
||||||
else:
|
break
|
||||||
raise
|
else:
|
||||||
|
raise
|
||||||
|
|
||||||
prev_hash = unhexlify(txin['prevout_hash'])
|
prev_hash = unhexlify(txin['prevout_hash'])
|
||||||
prev_index = txin['prevout_n']
|
prev_index = txin['prevout_n']
|
||||||
|
|
Loading…
Reference in New Issue