Merge #17532: test: add functional test for non-standard txs with too large scriptSig
8f2d7737cc
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, Commit5e8a56348b
): 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: ACK8f2d7737cc
instagibbs: ACK8f2d7737cc
Tree-SHA512: 7a45b8a4181158be3e3b91756783ddf032f132ca8780dc35fac91b2df2149268f784d28ac56005135c4d86a357c57805c5a54b8155f0d049932844b18dc03992
This commit is contained in:
commit
3671c5721d
1 changed files with 6 additions and 0 deletions
|
@ -267,6 +267,12 @@ class MempoolAcceptanceTest(BitcoinTestFramework):
|
||||||
rawtxs=[tx.serialize().hex()],
|
rawtxs=[tx.serialize().hex()],
|
||||||
)
|
)
|
||||||
tx.deserialize(BytesIO(hex_str_to_bytes(raw_tx_reference)))
|
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]))
|
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
|
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
|
tx.vout = [output_p2sh_burn] * num_scripts
|
||||||
|
|
Loading…
Reference in a new issue