main: don't undo indexes when verifying blocks at startup

This commit is contained in:
Braydon Fuller 2016-03-30 12:50:10 -04:00 committed by Braydon Fuller
parent 24894cb748
commit 21c675855f

View File

@ -2152,6 +2152,14 @@ bool DisconnectBlock(const CBlock& block, CValidationState& state, const CBlockI
}
// move best block pointer to prevout block
view.SetBestBlock(pindex->pprev->GetBlockHash());
if (pfClean) {
*pfClean = fClean;
return true;
}
if (fAddressIndex) {
if (!pblocktree->EraseAddressIndex(addressIndex)) {
return AbortNode(state, "Failed to delete address index");
@ -2161,14 +2169,6 @@ bool DisconnectBlock(const CBlock& block, CValidationState& state, const CBlockI
}
}
// move best block pointer to prevout block
view.SetBestBlock(pindex->pprev->GetBlockHash());
if (pfClean) {
*pfClean = fClean;
return true;
}
return fClean;
}