From 8f2d7737cc236b6122f30e31856eb3181960fba1 Mon Sep 17 00:00:00 2001 From: Sebastian Falbesoner Date: Wed, 20 Nov 2019 10:59:44 +0100 Subject: 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. --- test/functional/mempool_accept.py | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'test/functional/mempool_accept.py') diff --git a/test/functional/mempool_accept.py b/test/functional/mempool_accept.py index c466b120f2..0eef1d3ddf 100755 --- a/test/functional/mempool_accept.py +++ b/test/functional/mempool_accept.py @@ -267,6 +267,12 @@ class MempoolAcceptanceTest(BitcoinTestFramework): rawtxs=[tx.serialize().hex()], ) tx.deserialize(BytesIO(hex_str_to_bytes(raw_tx_reference))) + tx.vin[0].scriptSig = CScript([b'a' * 1648]) # Some too large scriptSig (>1650 bytes) + self.check_mempool_result( + result_expected=[{'txid': tx.rehash(), 'allowed': False, 'reject-reason': 'scriptsig-size'}], + rawtxs=[tx.serialize().hex()], + ) + tx.deserialize(BytesIO(hex_str_to_bytes(raw_tx_reference))) output_p2sh_burn = CTxOut(nValue=540, scriptPubKey=CScript([OP_HASH160, hash160(b'burn'), OP_EQUAL])) num_scripts = 100000 // len(output_p2sh_burn.serialize()) # Use enough outputs to make the tx too large for our policy tx.vout = [output_p2sh_burn] * num_scripts -- cgit v1.2.3