Skip to content

Commit b7fa4aa

Browse files
committed
Don't call removeForReorg if DisconnectTip fails
1 parent 7e49f5f commit b7fa4aa

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
@@ -2521,11 +2521,8 @@ static bool ActivateBestChainStep(CValidationState& state, const CChainParams& c
25212521
// Disconnect active blocks which are no longer in the best chain.
25222522
bool fBlocksDisconnected = false;
25232523
while (chainActive.Tip() && chainActive.Tip() != pindexFork) {
2524-
if (!DisconnectTip(state, chainparams.GetConsensus())) {
2525-
// Probably an AbortNode() error, but try to keep mempool consistent anyway
2526-
mempool.removeForReorg(pcoinsTip, chainActive.Tip()->nHeight + 1);
2524+
if (!DisconnectTip(state, chainparams.GetConsensus()))
25272525
return false;
2528-
}
25292526
fBlocksDisconnected = true;
25302527
}
25312528

@@ -2559,9 +2556,6 @@ static bool ActivateBestChainStep(CValidationState& state, const CChainParams& c
25592556
break;
25602557
} else {
25612558
// A system error occurred (disk space, database error, ...).
2562-
// Probably gonna shut down ASAP, but try to keep mempool consistent anyway
2563-
if (fBlocksDisconnected)
2564-
mempool.removeForReorg(pcoinsTip, chainActive.Tip()->nHeight + 1);
25652559
return false;
25662560
}
25672561
} else {

0 commit comments

Comments
 (0)