mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-01-21 07:39:08 +01:00
validation: Pass in chain to ::TestLockPointValidity
This commit is contained in:
@@ -237,7 +237,7 @@ bool CheckFinalTx(const CBlockIndex* active_chain_tip, const CTransaction &tx, i
|
||||
return IsFinalTx(tx, nBlockHeight, nBlockTime);
|
||||
}
|
||||
|
||||
bool TestLockPointValidity(const LockPoints* lp)
|
||||
bool TestLockPointValidity(CChain& active_chain, const LockPoints* lp)
|
||||
{
|
||||
AssertLockHeld(cs_main);
|
||||
assert(lp);
|
||||
@@ -246,7 +246,8 @@ bool TestLockPointValidity(const LockPoints* lp)
|
||||
if (lp->maxInputBlock) {
|
||||
// Check whether ::ChainActive() is an extension of the block at which the LockPoints
|
||||
// calculation was valid. If not LockPoints are no longer valid
|
||||
if (!::ChainActive().Contains(lp->maxInputBlock)) {
|
||||
assert(std::addressof(::ChainActive()) == std::addressof(active_chain));
|
||||
if (!active_chain.Contains(lp->maxInputBlock)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user