1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-12-23 06:48:16 +00:00

trezorctl: fix bip115 handling

This commit is contained in:
Tibor Arpas 2018-10-20 22:34:25 +02:00 committed by Pavol Rusnak
parent e52cbed7be
commit 1a239201d8
No known key found for this signature in database
GPG Key ID: 91F3B339B9A02A3D

View File

@ -833,10 +833,14 @@ def sign_tx(connect, coin):
if txapi.bip115: if txapi.bip115:
current_block_height = txapi.current_height() current_block_height = txapi.current_height()
block_height = ( # Zencash recommendation for the better protection
current_block_height - 300 block_height = current_block_height - 300
) # Zencash recommendation for the better protection
block_hash = txapi.get_block_hash(block_height) 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 = [] outputs = []
while True: while True:
@ -868,7 +872,7 @@ def sign_tx(connect, coin):
address=address, address=address,
amount=amount, amount=amount,
script_type=script_type, 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, block_height_bip115=block_height,
) )
) )