Skip to content

Commit 3671c57

Browse files
committed
Merge #17532: test: add functional test for non-standard txs with too large scriptSig
8f2d773 test: add functional test for non-standard txs with too large scriptSig (Sebastian Falbesoner) Pull request description: Approaches another missing functional test of issue #17394 (counterpart to unit test in PR #17480, Commit bitcoin/bitcoin@5e8a563): A transaction is rejected by the mempool with reason `"scriptsig-size"` if any of the inputs' scriptSig is larger than 1650 bytes. ACKs for top commit: MarcoFalke: ACK 8f2d773 instagibbs: ACK bitcoin/bitcoin@8f2d773 Tree-SHA512: 7a45b8a4181158be3e3b91756783ddf032f132ca8780dc35fac91b2df2149268f784d28ac56005135c4d86a357c57805c5a54b8155f0d049932844b18dc03992
2 parents 76e777d + 8f2d773 commit 3671c57

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)