From 1a239201d8751664d6a0030859c3d0fbd524e2a0 Mon Sep 17 00:00:00 2001 From: Tibor Arpas Date: Sat, 20 Oct 2018 22:34:25 +0200 Subject: [PATCH] trezorctl: fix bip115 handling --- trezorctl | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/trezorctl b/trezorctl index 932de3be70..78c5f52445 100755 --- a/trezorctl +++ b/trezorctl @@ -833,10 +833,14 @@ def sign_tx(connect, coin): if txapi.bip115: current_block_height = txapi.current_height() - block_height = ( - current_block_height - 300 - ) # Zencash recommendation for the better protection + # Zencash recommendation for the better protection + block_height = current_block_height - 300 block_hash = txapi.get_block_hash(block_height) + # Blockhash passed in reverse order + block_hash = block_hash[::-1] + else: + block_height = None + block_hash = None outputs = [] while True: @@ -868,7 +872,7 @@ def sign_tx(connect, coin): address=address, amount=amount, script_type=script_type, - block_hash_bip115=block_hash[::-1], # Blockhash passed in reverse order + block_hash_bip115=block_hash, block_height_bip115=block_height, ) )