Skip to content

Commit 8f2d773

Browse files
committed
test: add functional test for non-standard txs with too large scriptSig
A transaction is rejected by the mempool with reason "scriptsig-size" if any of the inputs' scriptSig is larger than 1650 bytes.
1 parent b4a1da9 commit 8f2d773

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

test/functional/mempool_accept.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,12 @@ def run_test(self):
267267
rawtxs=[tx.serialize().hex()],
268268
)
269269
tx.deserialize(BytesIO(hex_str_to_bytes(raw_tx_reference)))
270+
tx.vin[0].scriptSig = CScript([b'a' * 1648]) # Some too large scriptSig (>1650 bytes)
271+
self.check_mempool_result(
272+
result_expected=[{'txid': tx.rehash(), 'allowed': False, 'reject-reason': 'scriptsig-size'}],
273+
rawtxs=[tx.serialize().hex()],
274+
)
275+
tx.deserialize(BytesIO(hex_str_to_bytes(raw_tx_reference)))
270276
output_p2sh_burn = CTxOut(nValue=540, scriptPubKey=CScript([OP_HASH160, hash160(b'burn'), OP_EQUAL]))
271277
num_scripts = 100000 // len(output_p2sh_burn.serialize()) # Use enough outputs to make the tx too large for our policy
272278
tx.vout = [output_p2sh_burn] * num_scripts

0 commit comments

Comments
 (0)