From 065e42976a70738770af256da810ddc1316a4496 Mon Sep 17 00:00:00 2001 From: brunoerg Date: Mon, 21 Jul 2025 14:52:35 -0300 Subject: [PATCH] test: IsFinalTx returns true when there is no locktime --- src/test/miner_tests.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/test/miner_tests.cpp b/src/test/miner_tests.cpp index ac21aa6c4df..9207f1bfc2c 100644 --- a/src/test/miner_tests.cpp +++ b/src/test/miner_tests.cpp @@ -523,6 +523,10 @@ void MinerTestingSetup::TestBasicMining(const CScript& scriptPubKey, const std:: BOOST_CHECK(TestSequenceLocks(CTransaction{tx}, tx_mempool)); // Sequence locks pass BOOST_CHECK(IsFinalTx(CTransaction(tx), m_node.chainman->ActiveChain().Tip()->nHeight + 2, m_node.chainman->ActiveChain().Tip()->GetMedianTimePast())); // Locktime passes on 2nd block + // ensure tx is final for a specific case where there is no locktime and block height is zero + tx.nLockTime = 0; + BOOST_CHECK(IsFinalTx(CTransaction(tx), /*nBlockHeight=*/0, m_node.chainman->ActiveChain().Tip()->GetMedianTimePast())); + // absolute time locked tx.vin[0].prevout.hash = txFirst[3]->GetHash(); tx.nLockTime = m_node.chainman->ActiveChain().Tip()->GetMedianTimePast();