validation: Pass in chain to ::TestLockPointValidity

This commit is contained in:
Carl Dong
2020-09-16 17:40:00 -04:00
parent 120aaba9ac
commit 71734c65dc
3 changed files with 5 additions and 4 deletions

View File

@@ -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;
}
}