File tree Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -115,7 +115,7 @@ def get_tx(self):
115115
116116# The following check prevents exploit of lack of merkle
117117# tree depth commitment (CVE-2017-12842)
118- class SizeTooSmall (BadTxTemplate ):
118+ class SizeExactly64 (BadTxTemplate ):
119119 reject_reason = "tx-size-small"
120120 expect_disconnect = False
121121 valid_in_block = True
@@ -129,6 +129,20 @@ def get_tx(self):
129129 tx .calc_sha256 ()
130130 return tx
131131
132+ class SizeSub64 (BadTxTemplate ):
133+ reject_reason = "tx-size-small"
134+ expect_disconnect = False
135+ valid_in_block = True
136+
137+ def get_tx (self ):
138+ tx = CTransaction ()
139+ tx .vin .append (self .valid_txin )
140+ tx .vout .append (CTxOut (0 , CScript ([OP_RETURN ] + ([OP_0 ] * (MIN_PADDING - 3 )))))
141+ assert len (tx .serialize_without_witness ()) == 63
142+ assert MIN_STANDARD_TX_NONWITNESS_SIZE - 1 == 64
143+ tx .calc_sha256 ()
144+ return tx
145+
132146
133147class BadInputOutpointIndex (BadTxTemplate ):
134148 # Won't be rejected - nonexistent outpoint index is treated as an orphan since the coins
You can’t perform that action at this time.
0 commit comments