protocol: speed up sync by minimizing duplicate work

In particular, the prepare_handle_incoming_blocks call
is pretty lengthy, and entirely pointless in the common
case where several different connections will prepare
the exact same blocks.
This commit is contained in:
moneromooo-monero 2017-02-12 17:17:30 +00:00
parent 61dfa310d7
commit 8bdc86beb4
No known key found for this signature in database
GPG key ID: 686F07454D6CEFC3
2 changed files with 31 additions and 2 deletions

View file

@ -135,6 +135,7 @@ namespace cryptonote
std::atomic<bool> m_synchronized;
bool m_one_request = true;
std::atomic<bool> m_stopping;
epee::critical_section m_sync_lock;
boost::mutex m_buffer_mutex;
double get_avg_block_size();