mirror of
https://github.com/trezor/trezor-firmware.git
synced 2024-12-27 00:28:10 +00:00
Merge pull request #497 from romanz/segwit-multisig
core/wallet: fix segwit multisig comment
This commit is contained in:
commit
c66a1e7780
@ -179,7 +179,7 @@ def witness_p2wsh(
|
|||||||
redeem_script_length = output_script_multisig_length(pubkeys, multisig.m)
|
redeem_script_length = output_script_multisig_length(pubkeys, multisig.m)
|
||||||
|
|
||||||
# length of the result
|
# length of the result
|
||||||
total_length = 1 + 1 # number of items, version
|
total_length = 1 + 1 # number of items, OP_FALSE
|
||||||
for s in signatures:
|
for s in signatures:
|
||||||
total_length += 1 + len(s) + 1 # length, signature, sighash
|
total_length += 1 + len(s) + 1 # length, signature, sighash
|
||||||
total_length += 1 + redeem_script_length # length, script
|
total_length += 1 + redeem_script_length # length, script
|
||||||
@ -187,7 +187,10 @@ def witness_p2wsh(
|
|||||||
w = empty_bytearray(total_length)
|
w = empty_bytearray(total_length)
|
||||||
|
|
||||||
write_varint(w, num_of_witness_items)
|
write_varint(w, num_of_witness_items)
|
||||||
write_varint(w, 0) # version 0 witness program
|
# Starts with OP_FALSE because of an old OP_CHECKMULTISIG bug, which
|
||||||
|
# consumes one additional item on the stack:
|
||||||
|
# https://bitcoin.org/en/developer-guide#standard-transactions
|
||||||
|
write_varint(w, 0)
|
||||||
|
|
||||||
for s in signatures:
|
for s in signatures:
|
||||||
append_signature(w, s, sighash) # size of the witness included
|
append_signature(w, s, sighash) # size of the witness included
|
||||||
|
Loading…
Reference in New Issue
Block a user