mirror of
https://github.com/dashpay/dash.git
synced 2024-12-27 04:52:59 +01:00
Don't call removeForReorg if DisconnectTip fails
This commit is contained in:
parent
7e49f5f8b4
commit
b7fa4aa387
@ -2521,11 +2521,8 @@ static bool ActivateBestChainStep(CValidationState& state, const CChainParams& c
|
|||||||
// Disconnect active blocks which are no longer in the best chain.
|
// Disconnect active blocks which are no longer in the best chain.
|
||||||
bool fBlocksDisconnected = false;
|
bool fBlocksDisconnected = false;
|
||||||
while (chainActive.Tip() && chainActive.Tip() != pindexFork) {
|
while (chainActive.Tip() && chainActive.Tip() != pindexFork) {
|
||||||
if (!DisconnectTip(state, chainparams.GetConsensus())) {
|
if (!DisconnectTip(state, chainparams.GetConsensus()))
|
||||||
// Probably an AbortNode() error, but try to keep mempool consistent anyway
|
|
||||||
mempool.removeForReorg(pcoinsTip, chainActive.Tip()->nHeight + 1);
|
|
||||||
return false;
|
return false;
|
||||||
}
|
|
||||||
fBlocksDisconnected = true;
|
fBlocksDisconnected = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2559,9 +2556,6 @@ static bool ActivateBestChainStep(CValidationState& state, const CChainParams& c
|
|||||||
break;
|
break;
|
||||||
} else {
|
} else {
|
||||||
// A system error occurred (disk space, database error, ...).
|
// A system error occurred (disk space, database error, ...).
|
||||||
// Probably gonna shut down ASAP, but try to keep mempool consistent anyway
|
|
||||||
if (fBlocksDisconnected)
|
|
||||||
mempool.removeForReorg(pcoinsTip, chainActive.Tip()->nHeight + 1);
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user