aboutsummaryrefslogtreecommitdiff
path: root/src/cryptonote_protocol
diff options
context:
space:
mode:
authormoneromooo-monero <moneromooo-monero@users.noreply.github.com>2016-11-09 10:52:29 +0000
committermoneromooo-monero <moneromooo-monero@users.noreply.github.com>2016-11-09 11:04:20 +0000
commit5c4cb96cfbbc9d9a1602bc25cb8828882efc7b4b (patch)
treee9b23fb20255e9629140913a9541cb8cc228c660 /src/cryptonote_protocol
parentMerge pull request #1308 (diff)
downloadmonero-5c4cb96cfbbc9d9a1602bc25cb8828882efc7b4b.tar.xz
cryptonote_protocol: drop connection when find_blockchain_supplement fails
This will be when we can't find common ground between the peer's short chain history and our blockchain. This fixes bad peers claiming a higher blockchain height from never dropped, and keeping the node in synchronizing state forever, since we will never get blocks from that peer.
Diffstat (limited to 'src/cryptonote_protocol')
-rw-r--r--src/cryptonote_protocol/cryptonote_protocol_handler.inl1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/cryptonote_protocol/cryptonote_protocol_handler.inl b/src/cryptonote_protocol/cryptonote_protocol_handler.inl
index 5232d550a..10756a8ad 100644
--- a/src/cryptonote_protocol/cryptonote_protocol_handler.inl
+++ b/src/cryptonote_protocol/cryptonote_protocol_handler.inl
@@ -622,6 +622,7 @@ namespace cryptonote
if(!m_core.find_blockchain_supplement(arg.block_ids, r))
{
LOG_ERROR_CCONTEXT("Failed to handle NOTIFY_REQUEST_CHAIN.");
+ m_p2p->drop_connection(context);
return 1;
}
LOG_PRINT_CCONTEXT_L2("-->>NOTIFY_RESPONSE_CHAIN_ENTRY: m_start_height=" << r.start_height << ", m_total_height=" << r.total_height << ", m_block_ids.size()=" << r.m_block_ids.size());