1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-11-26 17:38:39 +00:00

wallet/signing: stream signatures for segwit inputs

This commit is contained in:
Jan Pochyla 2017-11-15 14:34:11 +01:00 committed by Tomas Susanka
parent 5a6b2a5a97
commit f56d39a447

View File

@ -231,13 +231,12 @@ async def sign_tx(tx: SignTx, root):
bip143_hash = bip143.preimage_hash(tx, txi, ecdsa_hash_pubkey(key_sign_pub)) bip143_hash = bip143.preimage_hash(tx, txi, ecdsa_hash_pubkey(key_sign_pub))
signature = ecdsa_sign(key_sign, bip143_hash) signature = ecdsa_sign(key_sign, bip143_hash)
witness = get_p2wpkh_witness(signature, key_sign_pub) witness = get_p2wpkh_witness(signature, key_sign_pub)
tx_ser.signature_index = i
tx_ser.signature = signature
tx_ser.serialized_tx = witness tx_ser.serialized_tx = witness
tx_req.serialized = tx_ser tx_req.serialized = tx_ser
# else
# witness is 0x00
write_uint32(tx_ser.serialized_tx, tx.lock_time) write_uint32(tx_ser.serialized_tx, tx.lock_time)