mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-15 12:51:00 +02:00
validation: Pass in chain to ::TestLockPointValidity
This commit is contained in:
parent
120aaba9ac
commit
71734c65dc
3 changed files with 5 additions and 4 deletions
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue