Skip to content

Commit 1f44958

Browse files
committed
test: add bad-txns-prevout-null test to mempool_accept.py
1 parent aa0a5bb commit 1f44958

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

test/functional/mempool_accept.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
BIP125_SEQUENCE_NUMBER,
1414
COIN,
1515
COutPoint,
16+
CTxIn,
1617
CTxOut,
1718
MAX_BLOCK_BASE_SIZE,
1819
MAX_MONEY,
@@ -247,6 +248,14 @@ def run_test(self):
247248
rawtxs=[tx.serialize().hex()],
248249
)
249250

251+
self.log.info('A non-coinbase transaction with coinbase-like outpoint')
252+
tx = tx_from_hex(raw_tx_reference)
253+
tx.vin.append(CTxIn(COutPoint(hash=0, n=0xffffffff)))
254+
self.check_mempool_result(
255+
result_expected=[{'txid': tx.rehash(), 'allowed': False, 'reject-reason': 'bad-txns-prevout-null'}],
256+
rawtxs=[tx.serialize().hex()],
257+
)
258+
250259
self.log.info('A coinbase transaction')
251260
# Pick the input of the first tx we signed, so it has to be a coinbase tx
252261
raw_tx_coinbase_spent = node.getrawtransaction(txid=node.decoderawtransaction(hexstring=raw_tx_in_block)['vin'][0]['txid'])

0 commit comments

Comments
 (0)