From 4f8e01c5df8c7f4ab9d30bbb3078657edb76e24f Mon Sep 17 00:00:00 2001 From: Jan Pochyla Date: Fri, 11 Nov 2016 11:20:26 +0100 Subject: [PATCH] signtx: fix address derivation --- src/apps/common/signtx.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/apps/common/signtx.py b/src/apps/common/signtx.py index 2c0323a390..d0521de92b 100644 --- a/src/apps/common/signtx.py +++ b/src/apps/common/signtx.py @@ -296,13 +296,13 @@ def output_paytoaddress_extract_raw_address(o: TxOutputType, coin: CoinType, roo # TODO: detect correct address type if o_address_n is not None: 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: raw_address = base58.decode_check(o_address) + if raw_address[0] != coin.address_type: + raise SigningError('Invalid address type') else: raise SigningError('Missing address') - if raw_address[0] != coin.address_type: - raise SigningError('Invalid address type') return raw_address