aboutsummaryrefslogtreecommitdiff
path: root/test/functional
diff options
context:
space:
mode:
authorSebastian Falbesoner <sebastian.falbesoner@gmail.com>2019-11-20 10:59:44 +0100
committerSebastian Falbesoner <sebastian.falbesoner@gmail.com>2019-11-20 11:01:27 +0100
commit8f2d7737cc236b6122f30e31856eb3181960fba1 (patch)
tree9f918a439a52b3c5afa5b8099a567ddc3dbae223 /test/functional
parentb4a1da9ef8e4b673c290d5b882527e627ae1b43a (diff)
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.
Diffstat (limited to 'test/functional')
-rwxr-xr-xtest/functional/mempool_accept.py6
1 files changed, 6 insertions, 0 deletions
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