Skip to content

Commit 065e429

Browse files
committed
test: IsFinalTx returns true when there is no locktime
1 parent 7129c9e commit 065e429

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/test/miner_tests.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -523,6 +523,10 @@ void MinerTestingSetup::TestBasicMining(const CScript& scriptPubKey, const std::
523523
BOOST_CHECK(TestSequenceLocks(CTransaction{tx}, tx_mempool)); // Sequence locks pass
524524
BOOST_CHECK(IsFinalTx(CTransaction(tx), m_node.chainman->ActiveChain().Tip()->nHeight + 2, m_node.chainman->ActiveChain().Tip()->GetMedianTimePast())); // Locktime passes on 2nd block
525525

526+
// ensure tx is final for a specific case where there is no locktime and block height is zero
527+
tx.nLockTime = 0;
528+
BOOST_CHECK(IsFinalTx(CTransaction(tx), /*nBlockHeight=*/0, m_node.chainman->ActiveChain().Tip()->GetMedianTimePast()));
529+
526530
// absolute time locked
527531
tx.vin[0].prevout.hash = txFirst[3]->GetHash();
528532
tx.nLockTime = m_node.chainman->ActiveChain().Tip()->GetMedianTimePast();

0 commit comments

Comments
 (0)