Skip to content

Commit

Permalink
Blockchain: fix temp fails causing alt blocks to be permanently invalid
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffro256 committed Jul 11, 2024
1 parent cc73fe7 commit 7fdaf61
Showing 1 changed file with 0 additions and 6 deletions.
6 changes: 0 additions & 6 deletions src/cryptonote_core/blockchain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1209,20 +1209,14 @@ bool Blockchain::switch_to_alternative_blockchain(std::list<block_extended_info>
// just the latter (because the rollback was done above).
rollback_blockchain_switching(disconnected_chain, split_height);

// FIXME: Why do we keep invalid blocks around? Possibly in case we hear
// about them again so we can immediately dismiss them, but needs some
// looking into.
const crypto::hash blkid = cryptonote::get_block_hash(bei.bl);
add_block_as_invalid(bei, blkid);
MERROR("The block was inserted as invalid while connecting new alternative chain, block_id: " << blkid);
m_db->remove_alt_block(blkid);
alt_ch_iter++;

for(auto alt_ch_to_orph_iter = alt_ch_iter; alt_ch_to_orph_iter != alt_chain.end(); )
{
const auto &bei = *alt_ch_to_orph_iter++;
const crypto::hash blkid = cryptonote::get_block_hash(bei.bl);
add_block_as_invalid(bei, blkid);
m_db->remove_alt_block(blkid);
}
return false;
Expand Down

0 comments on commit 7fdaf61

Please sign in to comment.