mirror of
https://git.wownero.com/wownero/wownero.git
synced 2024-12-23 07:38:53 +00:00
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.
This commit is contained in:
parent
a9b83f5a6e
commit
aa0ea0aafc
@ -3323,6 +3323,7 @@ bool Blockchain::handle_block_to_main_chain(const block& bl, const crypto::hash&
|
|||||||
if(bl.prev_id != get_tail_id())
|
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());
|
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:
|
leave:
|
||||||
m_db->block_txn_stop();
|
m_db->block_txn_stop();
|
||||||
return false;
|
return false;
|
||||||
@ -3624,6 +3625,7 @@ leave:
|
|||||||
{
|
{
|
||||||
//TODO: figure out the best way to deal with this failure
|
//TODO: figure out the best way to deal with this failure
|
||||||
LOG_ERROR("Error adding block with hash: " << id << " to blockchain, what = " << e.what());
|
LOG_ERROR("Error adding block with hash: " << id << " to blockchain, what = " << e.what());
|
||||||
|
bvc.m_verifivation_failed = true;
|
||||||
return_tx_to_pool(txs);
|
return_tx_to_pool(txs);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user