aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Falbesoner <sebastian.falbesoner@gmail.com>2021-07-05 23:06:06 +0200
committerSebastian Falbesoner <sebastian.falbesoner@gmail.com>2021-07-05 23:06:06 +0200
commit1f449586a9e39bc4fb53cb5c7a31362e47aea19b (patch)
tree023050e6a48efef100c79f805d01cb94821609a2
parentaa0a5bb70d77739d43d5a9ceae78fb0c6fafd435 (diff)
test: add `bad-txns-prevout-null` test to mempool_accept.py
-rwxr-xr-xtest/functional/mempool_accept.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/functional/mempool_accept.py b/test/functional/mempool_accept.py
index 1705d957aa..3b69c55f2c 100755
--- a/test/functional/mempool_accept.py
+++ b/test/functional/mempool_accept.py
@@ -13,6 +13,7 @@ from test_framework.messages import (
BIP125_SEQUENCE_NUMBER,
COIN,
COutPoint,
+ CTxIn,
CTxOut,
MAX_BLOCK_BASE_SIZE,
MAX_MONEY,
@@ -247,6 +248,14 @@ class MempoolAcceptanceTest(BitcoinTestFramework):
rawtxs=[tx.serialize().hex()],
)
+ self.log.info('A non-coinbase transaction with coinbase-like outpoint')
+ tx = tx_from_hex(raw_tx_reference)
+ tx.vin.append(CTxIn(COutPoint(hash=0, n=0xffffffff)))
+ self.check_mempool_result(
+ result_expected=[{'txid': tx.rehash(), 'allowed': False, 'reject-reason': 'bad-txns-prevout-null'}],
+ rawtxs=[tx.serialize().hex()],
+ )
+
self.log.info('A coinbase transaction')
# Pick the input of the first tx we signed, so it has to be a coinbase tx
raw_tx_coinbase_spent = node.getrawtransaction(txid=node.decoderawtransaction(hexstring=raw_tx_in_block)['vin'][0]['txid'])