aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSuhas Daftuar <sdaftuar@gmail.com>2015-11-12 15:54:17 -0500
committerSuhas Daftuar <sdaftuar@gmail.com>2015-11-30 13:12:55 -0500
commitb7fa4aa3876b56694b27af0beef367be9e0733fd (patch)
tree56e7b048f164a214890ab78282a35d23e3888360 /src
parent7e49f5f8b4e237d7212d027a7bea4bbd52c9e7b6 (diff)
downloadbitcoin-b7fa4aa3876b56694b27af0beef367be9e0733fd.tar.xz
Don't call removeForReorg if DisconnectTip fails
Diffstat (limited to 'src')
-rw-r--r--src/main.cpp8
1 files changed, 1 insertions, 7 deletions
diff --git a/src/main.cpp b/src/main.cpp
index ad8819eb3d..feb526e09c 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -2521,11 +2521,8 @@ static bool ActivateBestChainStep(CValidationState& state, const CChainParams& c
// Disconnect active blocks which are no longer in the best chain.
bool fBlocksDisconnected = false;
while (chainActive.Tip() && chainActive.Tip() != pindexFork) {
- if (!DisconnectTip(state, chainparams.GetConsensus())) {
- // Probably an AbortNode() error, but try to keep mempool consistent anyway
- mempool.removeForReorg(pcoinsTip, chainActive.Tip()->nHeight + 1);
+ if (!DisconnectTip(state, chainparams.GetConsensus()))
return false;
- }
fBlocksDisconnected = true;
}
@@ -2559,9 +2556,6 @@ static bool ActivateBestChainStep(CValidationState& state, const CChainParams& c
break;
} else {
// 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;
}
} else {