Merge pull request #5890

cd3d67c Fix InvalidateBlock to add chainActive.Tip to setBlockIndexCandidates (Alex Morcos)
This commit is contained in:
Wladimir J. van der Laan
2015-03-24 14:45:00 +01:00
2 changed files with 28 additions and 3 deletions

View File

@@ -2320,7 +2320,7 @@ bool InvalidateBlock(CValidationState& state, CBlockIndex *pindex) {
// add them again.
BlockMap::iterator it = mapBlockIndex.begin();
while (it != mapBlockIndex.end()) {
if (it->second->IsValid(BLOCK_VALID_TRANSACTIONS) && it->second->nChainTx && setBlockIndexCandidates.value_comp()(chainActive.Tip(), it->second)) {
if (it->second->IsValid(BLOCK_VALID_TRANSACTIONS) && it->second->nChainTx && !setBlockIndexCandidates.value_comp()(it->second, chainActive.Tip())) {
setBlockIndexCandidates.insert(it->second);
}
it++;