Skip to content

Commit aa0a5bb

Browse files
committed
test: add bad-txns-prevout-null test case to invalid_txs.py
This reject reason is triggered for non-coinbase transactions with a coinbase-like outpoint, i.e. hash=0, n=0xffffffff. Note that the invalid tx templates are currently used in the functional tests feature_block.py and p2p_invalid_tx.py.
1 parent 2711559 commit aa0a5bb

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

test/functional/data/invalid_txs.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,19 @@ def get_tx(self):
151151
return tx
152152

153153

154+
class PrevoutNullInput(BadTxTemplate):
155+
reject_reason = 'bad-txns-prevout-null'
156+
expect_disconnect = True
157+
158+
def get_tx(self):
159+
tx = CTransaction()
160+
tx.vin.append(self.valid_txin)
161+
tx.vin.append(CTxIn(COutPoint(hash=0, n=0xffffffff)))
162+
tx.vout.append(CTxOut(1, basic_p2sh))
163+
tx.calc_sha256()
164+
return tx
165+
166+
154167
class NonexistentInput(BadTxTemplate):
155168
reject_reason = None # Added as an orphan tx.
156169
expect_disconnect = False

0 commit comments

Comments
 (0)