validation: Pass in chainstate to ::CheckSequenceLocks

This commit is contained in:
Carl Dong
2020-09-16 17:29:10 -04:00
parent 577b774d0c
commit 4c15942b79
4 changed files with 11 additions and 10 deletions

View File

@@ -512,7 +512,7 @@ void CTxMemPool::removeForReorg(const CCoinsViewCache *pcoins, unsigned int nMem
const CTransaction& tx = it->GetTx();
LockPoints lp = it->GetLockPoints();
bool validLP = TestLockPointValidity(&lp);
if (!CheckFinalTx(::ChainActive().Tip(), tx, flags) || !CheckSequenceLocks(*this, tx, flags, &lp, validLP)) {
if (!CheckFinalTx(::ChainActive().Tip(), tx, flags) || !CheckSequenceLocks(::ChainstateActive(), *this, tx, flags, &lp, validLP)) {
// Note if CheckSequenceLocks fails the LockPoints may still be invalid
// So it's critical that we remove the tx and not depend on the LockPoints.
txToRemove.insert(it);