#include <cryptonote_protocol_handler.h>
◆ cryptonote_protocol_handler_base()
| cryptonote::cryptonote_protocol_handler_base::cryptonote_protocol_handler_base |
( |
| ) |
|
◆ ~cryptonote_protocol_handler_base()
| cryptonote::cryptonote_protocol_handler_base::~cryptonote_protocol_handler_base |
( |
| ) |
|
|
virtual |
◆ estimate_one_block_size()
| double cryptonote::cryptonote_protocol_handler_base::estimate_one_block_size |
( |
| ) |
|
|
virtualnoexcept |
Definition at line 83 of file cryptonote_protocol_handler-base.cpp.
83 {
84 const double size_min = 500;
85
86
87 double avg=0;
88 try {
90 } catch (...) { }
91 avg = std::max( size_min , avg);
92 return avg;
93}
virtual double get_avg_block_size()=0
◆ get_avg_block_size()
| virtual double cryptonote::cryptonote_protocol_handler_base::get_avg_block_size |
( |
| ) |
|
|
pure virtual |
◆ handler_request_blocks_history()
| void cryptonote::cryptonote_protocol_handler_base::handler_request_blocks_history |
( |
std::list< crypto::hash > & | ids | ) |
|
◆ handler_response_blocks_now()
| void cryptonote::cryptonote_protocol_handler_base::handler_response_blocks_now |
( |
size_t | packet_size | ) |
|
Definition at line 104 of file cryptonote_protocol_handler-base.cpp.
104 {
105 using namespace epee::net_utils;
106 double delay=0;
107 MDEBUG(
"Packet size: " << packet_size);
108 do
109 {
110
111
112
113
114
115
116
117
118
119
120 {
122 delay = network_throttle_manager::get_global_throttle_out().get_sleep_time_after_tick( packet_size );
123 }
124
125
126 delay *= 0.50;
127
128 if (delay > 0) {
129
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 ) );
133 }
134 } while(delay > 0);
135
136
137 {
139 network_throttle_manager::get_global_throttle_out().handle_trafic_tcp( packet_size );
140
141
142 }
143}
#define CRITICAL_REGION_LOCAL(x)
The documentation for this class was generated from the following files: