File tree 1 file changed +7
-4
lines changed
1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -543,11 +543,14 @@ def run_test(self):
543
543
break
544
544
psbt_in = dec ["inputs" ][input_idx ]
545
545
# Calculate the input weight
546
- # (prevout + sequence + length of scriptSig + scriptsig + 1 byte buffer ) * WITNESS_SCALE_FACTOR + num scriptWitness stack items + ( length of stack item + stack item) * N stack items + 1 byte buffer
546
+ # (( prevout + sequence + length of scriptSig + scriptsig) * WITNESS_SCALE_FACTOR) + (( length of stack item + stack item) * N stack items)
547
547
len_scriptsig = len (psbt_in ["final_scriptSig" ]["hex" ]) // 2 if "final_scriptSig" in psbt_in else 0
548
- len_scriptsig += len (ser_compact_size (len_scriptsig )) + 1
549
- len_scriptwitness = (sum ([(len (x ) // 2 ) + len (ser_compact_size (len (x ) // 2 )) for x in psbt_in ["final_scriptwitness" ]]) + len (psbt_in ["final_scriptwitness" ]) + 1 ) if "final_scriptwitness" in psbt_in else 0
550
- input_weight = ((40 + len_scriptsig ) * WITNESS_SCALE_FACTOR ) + len_scriptwitness
548
+ len_scriptsig += len (ser_compact_size (len_scriptsig ))
549
+ len_scriptwitness = (sum ([(len (x ) // 2 ) + len (ser_compact_size (len (x ) // 2 )) for x in psbt_in ["final_scriptwitness" ]])) if "final_scriptwitness" in psbt_in else 0
550
+ len_txid = 32
551
+ len_out_index = 4
552
+ len_sequence = 4
553
+ input_weight = ((len_txid + len_out_index + len_sequence + len_scriptsig ) * WITNESS_SCALE_FACTOR ) + len_scriptwitness
551
554
552
555
# Input weight error conditions
553
556
assert_raises_rpc_error (
You can’t perform that action at this time.
0 commit comments