mirror of
https://github.com/monero-project/monero.git
synced 2025-08-16 19:50:19 -04:00
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
This commit is contained in:
parent
4466b6d1b0
commit
70b8c6d77a
5 changed files with 109 additions and 38 deletions
|
@ -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;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue