Skip to content

Commit fa1da43

Browse files
committed
tx: witness byte double counted
`bitcoin_tx_input_weight` already adds the prefix byte for counting the witness items
1 parent 05a41bf commit fa1da43

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

bitcoin/tx.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -950,8 +950,7 @@ size_t bitcoin_tx_2of2_input_witness_weight(void)
950950
/* BOLT #03:
951951
* Signatures are 73 bytes long (the maximum length).
952952
*/
953-
return 1 + /* Prefix: 4 elements to push on stack */
954-
(1 + 0) + /* [0]: witness-marker-and-flag */
953+
return (1 + 0) + /* [0]: witness-marker-and-flag */
955954
(1 + 73) + /* [1] Party A signature and length prefix */
956955
(1 + 73) + /* [2] Party B signature and length prefix */
957956
(1 + 1 + /* [3] length prefix and numpushes (2) */

0 commit comments

Comments
 (0)