Fix InvalidateBlock to add chainActive.Tip to setBlockIndexCandidates

This commit is contained in:
Alex Morcos
2015-03-12 16:03:23 -04:00
parent 7077fe6dd4
commit cd3d67cf3b
2 changed files with 28 additions and 3 deletions

View File

@@ -2310,7 +2310,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++;