protocol: fix reorgs while syncing

This commit is contained in:
moneromooo-monero 2017-08-12 10:59:27 +01:00
parent 181a008aa3
commit 08abb670e1
No known key found for this signature in database
GPG key ID: 686F07454D6CEFC3
5 changed files with 48 additions and 289 deletions

View file

@ -39,7 +39,8 @@ namespace cryptonote
struct cryptonote_connection_context: public epee::net_utils::connection_context_base
{
cryptonote_connection_context(): m_state(state_befor_handshake), m_remote_blockchain_height(0), m_last_response_height(0) {}
cryptonote_connection_context(): m_state(state_befor_handshake), m_remote_blockchain_height(0), m_last_response_height(0),
m_last_known_hash(cryptonote::null_hash) {}
enum state
{
@ -56,6 +57,7 @@ namespace cryptonote
uint64_t m_last_response_height;
boost::posix_time::ptime m_last_request_time;
epee::copyable_atomic m_callback_request_count; //in debug purpose: problem with double callback rise
crypto::hash m_last_known_hash;
//size_t m_score; TODO: add score calculations
};