mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-08-25 02:50:55 +02:00
test: IsFinalTx returns true when there is no locktime
This commit is contained in:
@@ -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();
|
||||
|
Reference in New Issue
Block a user