aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfanquake <fanquake@gmail.com>2019-11-20 11:14:37 -0500
committerfanquake <fanquake@gmail.com>2019-11-20 11:29:27 -0500
commit3671c5721d42b17edbcafd8c4811f5f6316fda3e (patch)
treeaf53f1e0a52f4fbdb714338e19fdc0fe6d328509
parent76e777df83db4fc14d5cf96c67ceaa554a016a3a (diff)
parent8f2d7737cc236b6122f30e31856eb3181960fba1 (diff)
downloadbitcoin-3671c5721d42b17edbcafd8c4811f5f6316fda3e.tar.xz
Merge #17532: test: add functional test for non-standard txs with too large scriptSig
8f2d7737cc236b6122f30e31856eb3181960fba1 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 https://github.com/bitcoin/bitcoin/commit/5e8a56348b5e1026e9ddcae0b2fa2a68faf4439e): 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 8f2d7737cc236b6122f30e31856eb3181960fba1 instagibbs: ACK https://github.com/bitcoin/bitcoin/pull/17532/commits/8f2d7737cc236b6122f30e31856eb3181960fba1 Tree-SHA512: 7a45b8a4181158be3e3b91756783ddf032f132ca8780dc35fac91b2df2149268f784d28ac56005135c4d86a357c57805c5a54b8155f0d049932844b18dc03992
-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