43 #include <boost/chrono.hpp> 44 #include <boost/date_time/posix_time/posix_time.hpp> 45 #include <boost/thread/thread.hpp> 56 #undef ELECTRONEUM_DEFAULT_LOG_CATEGORY 57 #define ELECTRONEUM_DEFAULT_LOG_CATEGORY "net.cn" 84 const double size_min = 500;
91 avg = std::max( size_min , avg);
107 MDEBUG(
"Packet size: " << packet_size);
122 delay = network_throttle_manager::get_global_throttle_out().get_sleep_time_after_tick( packet_size );
130 long int ms = (
long int)(delay * 1000);
131 MDEBUG(
"Sleeping for " << ms <<
" ms before packet_size="<<packet_size);
132 boost::this_thread::sleep(boost::posix_time::milliseconds( ms ) );
139 network_throttle_manager::get_global_throttle_out().handle_trafic_tcp( packet_size );
void handler_request_blocks_history(std::list< crypto::hash > &ids)
virtual double estimate_one_block_size() noexcept
virtual ~cryptonote_protocol_handler_base()
void handler_response_blocks_now(size_t packet_size)
virtual double get_avg_block_size()=0
Holds cryptonote related classes and helpers.
interface for throttling of connection (count and rate-limit speed etc)
#define CRITICAL_REGION_LOCAL(x)
This is the orginal cryptonote protocol network-events handler, modified by us.
cryptonote_protocol_handler_base()