blockchain: set the m_verifivation_failed flag in a couple more places

when a block being added to the main chain is invalid.

This ensures the peer is banned after a number of these.
pull/71/head
moneromooo-monero 6 years ago committed by wowario
parent e492718cd0
commit a896603556
No known key found for this signature in database
GPG Key ID: 24DCBE762DE9C111

@ -3291,6 +3291,7 @@ bool Blockchain::handle_block_to_main_chain(const block& bl, const crypto::hash&
if(bl.prev_id != get_tail_id())
{
MERROR_VER("Block with id: " << id << std::endl << "has wrong prev_id: " << bl.prev_id << std::endl << "expected: " << get_tail_id());
bvc.m_verifivation_failed = true;
leave:
m_db->block_txn_stop();
return false;
@ -3591,6 +3592,7 @@ leave:
{
//TODO: figure out the best way to deal with this failure
LOG_ERROR("Error adding block with hash: " << id << " to blockchain, what = " << e.what());
bvc.m_verifivation_failed = true;
return_tx_to_pool(txs);
return false;
}

Loading…
Cancel
Save