aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormoneromooo-monero <moneromooo-monero@users.noreply.github.com>2018-06-27 18:34:15 +0100
committermoneromooo-monero <moneromooo-monero@users.noreply.github.com>2018-06-28 16:57:22 +0100
commitaa0ea0aafcee110e57686ce5ccff9b38b3370d10 (patch)
treedb3798524746b4f00377673aa560ee201b88dada
parentMerge pull request #4067 (diff)
downloadmonero-aa0ea0aafcee110e57686ce5ccff9b38b3370d10.tar.xz
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.
-rw-r--r--src/cryptonote_core/blockchain.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/cryptonote_core/blockchain.cpp b/src/cryptonote_core/blockchain.cpp
index 73ce98366..0c94d5dd8 100644
--- a/src/cryptonote_core/blockchain.cpp
+++ b/src/cryptonote_core/blockchain.cpp
@@ -3323,6 +3323,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;
@@ -3624,6 +3625,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;
}