From 37ae7c06a489fd27178b37c6559af927f43ad9ef Mon Sep 17 00:00:00 2001 From: Jochen Hoenicke Date: Thu, 28 Jun 2018 06:00:05 +0200 Subject: [PATCH] signtx layout: check if address starts with prefix Only addresses starting with bitcoincash: should get their prefix skipped. This fixes a bug where it skips the first bytes of legacy addresses. --- src/apps/wallet/sign_tx/layout.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/apps/wallet/sign_tx/layout.py b/src/apps/wallet/sign_tx/layout.py index 425cfe50d..852698786 100644 --- a/src/apps/wallet/sign_tx/layout.py +++ b/src/apps/wallet/sign_tx/layout.py @@ -29,7 +29,7 @@ async def confirm_output(ctx, output, coin): ui.MONO, *split_op_return(data), icon_color=ui.GREEN) else: address = output.address - address_short = address[len(coin.cashaddr_prefix) + 1:] if coin.cashaddr_prefix is not None else address + address_short = address[len(coin.cashaddr_prefix) + 1:] if coin.cashaddr_prefix is not None and address.startswith(coin.cashaddr_prefix + ':') else address content = Text('Confirm sending', ui.ICON_SEND, ui.NORMAL, format_coin_amount(output.amount, coin) + ' to', ui.MONO, *split_address(address_short), icon_color=ui.GREEN)