mirror of
https://github.com/trezor/trezor-firmware.git
synced 2025-01-18 19:31:04 +00:00
signtx: fix address derivation
This commit is contained in:
parent
24d8a04131
commit
4f8e01c5df
@ -296,13 +296,13 @@ def output_paytoaddress_extract_raw_address(o: TxOutputType, coin: CoinType, roo
|
|||||||
# TODO: detect correct address type
|
# TODO: detect correct address type
|
||||||
if o_address_n is not None:
|
if o_address_n is not None:
|
||||||
n = node_derive(root, o_address_n)
|
n = node_derive(root, o_address_n)
|
||||||
raw_address = base58.decode_check(n.address())
|
raw_address = base58.decode_check(n.address(coin.address_type))
|
||||||
elif o_address:
|
elif o_address:
|
||||||
raw_address = base58.decode_check(o_address)
|
raw_address = base58.decode_check(o_address)
|
||||||
|
if raw_address[0] != coin.address_type:
|
||||||
|
raise SigningError('Invalid address type')
|
||||||
else:
|
else:
|
||||||
raise SigningError('Missing address')
|
raise SigningError('Missing address')
|
||||||
if raw_address[0] != coin.address_type:
|
|
||||||
raise SigningError('Invalid address type')
|
|
||||||
return raw_address
|
return raw_address
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user