Skip to content

Commit d5fa33d

Browse files
committed
Don't call removeForReorg if DisconnectTip fails
1 parent ab912e0 commit d5fa33d

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

src/main.cpp

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2296,11 +2296,8 @@ static bool ActivateBestChainStep(CValidationState &state, CBlockIndex *pindexMo
22962296
// Disconnect active blocks which are no longer in the best chain.
22972297
bool fBlocksDisconnected = false;
22982298
while (chainActive.Tip() && chainActive.Tip() != pindexFork) {
2299-
if (!DisconnectTip(state, chainparams.GetConsensus())) {
2300-
// Probably an AbortNode() error, but try to keep mempool consistent anyway
2301-
mempool.removeForReorg(pcoinsTip, chainActive.Tip()->nHeight + 1);
2299+
if (!DisconnectTip(state, chainparams.GetConsensus()))
23022300
return false;
2303-
}
23042301
fBlocksDisconnected = true;
23052302
}
23062303

@@ -2334,9 +2331,6 @@ static bool ActivateBestChainStep(CValidationState &state, CBlockIndex *pindexMo
23342331
break;
23352332
} else {
23362333
// A system error occurred (disk space, database error, ...).
2337-
// Probably gonna shut down ASAP, but try to keep mempool consistent anyway
2338-
if (fBlocksDisconnected)
2339-
mempool.removeForReorg(pcoinsTip, chainActive.Tip()->nHeight + 1);
23402334
return false;
23412335
}
23422336
} else {

0 commit comments

Comments
 (0)