aboutsummaryrefslogtreecommitdiff
path: root/src/cryptonote_protocol/cryptonote_protocol_handler.h
diff options
context:
space:
mode:
authormoneromooo-monero <moneromooo-monero@users.noreply.github.com>2017-08-18 20:14:23 +0100
committermoneromooo-monero <moneromooo-monero@users.noreply.github.com>2017-08-21 21:57:19 +0100
commit70b8c6d77a6aaf90a6e84f3ec6f25bea3b163c40 (patch)
treed533e90a67366fd3a6778bb6f3da82bbe0a7d326 /src/cryptonote_protocol/cryptonote_protocol_handler.h
parentMerge pull request #2303 (diff)
downloadmonero-70b8c6d77a6aaf90a6e84f3ec6f25bea3b163c40.tar.xz
cryptonote_protocol: misc fixes to the new sync algorithm
Fix sync wedge corner case: It could happen if a connection went into standby mode, while it was the one which had requested the next span, and that span was still waiting for the data, and that peer is not on the main chain. Other peers can then start asking for that data again and again, but never get it as only that forked peer does. And various other fixes
Diffstat (limited to 'src/cryptonote_protocol/cryptonote_protocol_handler.h')
-rw-r--r--src/cryptonote_protocol/cryptonote_protocol_handler.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/cryptonote_protocol/cryptonote_protocol_handler.h b/src/cryptonote_protocol/cryptonote_protocol_handler.h
index d94747769..d54687e6a 100644
--- a/src/cryptonote_protocol/cryptonote_protocol_handler.h
+++ b/src/cryptonote_protocol/cryptonote_protocol_handler.h
@@ -111,6 +111,7 @@ namespace cryptonote
std::list<connection_info> get_connections();
const block_queue &get_block_queue() const { return m_block_queue; }
void stop();
+ void on_connection_close(cryptonote_connection_context &context);
private:
//----------------- commands handlers ----------------------------------------------
int handle_notify_new_block(int command, NOTIFY_NEW_BLOCK::request& arg, cryptonote_connection_context& context);
@@ -133,6 +134,7 @@ namespace cryptonote
bool should_download_next_span(cryptonote_connection_context& context) const;
void drop_connection(cryptonote_connection_context &context, bool add_fail, bool flush_all_spans);
bool kick_idle_peers();
+ int try_add_next_blocks(cryptonote_connection_context &context);
t_core& m_core;