1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-11-29 02:48:18 +00:00

src/apps/wallet/sign_tx: don't append bip115 replay protection script if no arguments provided

This commit is contained in:
Pavol Rusnak 2018-07-04 12:58:44 +02:00
parent 2b66deb3d6
commit 6d5a8645fd
No known key found for this signature in database
GPG Key ID: 91F3B339B9A02A3D

View File

@ -43,6 +43,8 @@ def output_script_p2sh(scripthash: bytes) -> bytearray:
def script_replay_protection_bip115(block_hash: bytes, block_height: bytes) -> bytearray:
if block_hash is None or block_height is None:
return bytearray()
block_height_size = len(block_height) # size in bytes of block_height (should be 3)
s = bytearray(38)
s[0] = 0x20 # 32 bytes for block hash