37 #include <boost/program_options/variables_map.hpp> 40 #include "math_helper.h" 41 #include "storages/levin_abstract_invoke2.h" 48 #include <boost/circular_buffer.hpp> 53 #define LOCALHOST_INT 2130706433 58 class cryptonote_protocol_handler_base_pimpl;
61 std::unique_ptr<cryptonote_protocol_handler_base_pimpl>
mI;
73 template<class t_core>
85 HANDLE_NOTIFY_T2(
NOTIFY_NEW_BLOCK, &cryptonote_protocol_handler::handle_notify_new_block)
96 bool init(const
boost::program_options::variables_map& vm);
101 bool get_payload_sync_data(
blobdata& data);
105 t_core& get_core(){
return m_core;}
107 void log_connections();
108 std::list<connection_info> get_connections();
129 size_t get_synchronizing_connections_count();
130 bool on_connection_synchronized();
133 bool kick_idle_peers();
149 boost::circular_buffer<size_t> m_avg_buffer = boost::circular_buffer<size_t>(10);
151 template<
class t_parameter>
154 LOG_PRINT_L2(
"[" << epee::net_utils::print_connection_context_short(context) <<
"] post " <<
typeid(t_parameter).
name() <<
" -->");
156 epee::serialization::store_t_to_binary(arg, blob);
161 template<
class t_parameter>
164 LOG_PRINT_L2(
"[" << epee::net_utils::print_connection_context_short(exclude_context) <<
"] post relay " <<
typeid(t_parameter).
name() <<
" -->");
165 std::string arg_buff;
166 epee::serialization::store_t_to_binary(arg, arg_buff);
Definition: cryptonote_protocol_defs.h:162
nodetool::p2p_endpoint_stub< connection_context > m_p2p_stub
Definition: cryptonote_protocol_handler.h:138
epee::math_helper::once_a_time_seconds< 30 > m_idle_peer_kicker
Definition: cryptonote_protocol_handler.h:145
void handler_request_blocks_history(std::list< crypto::hash > &ids)
Definition: cryptonote_protocol_handler-base.cpp:122
Definition: block_queue.h:47
virtual double estimate_one_block_size() noexcept
Definition: cryptonote_protocol_handler-base.cpp:104
PUSH_WARNINGS
Definition: hash-ops.h:53
std::unique_ptr< cryptonote_protocol_handler_base_pimpl > mI
Definition: cryptonote_protocol_handler.h:61
Definition: unordered_containers_boost_serialization.h:37
const block_queue & get_block_queue() const
Definition: cryptonote_protocol_handler.h:109
static void init(std::string cache_filename)
Definition: blockchain_blackball.cpp:223
cryptonote_connection_context connection_context
Definition: cryptonote_protocol_handler.h:77
std::atomic< uint32_t > m_syncronized_connections_count
Definition: cryptonote_protocol_handler.h:140
virtual ~cryptonote_protocol_handler_base()
Definition: cryptonote_protocol_handler-base.cpp:119
Definition: connection_context.h:40
Definition: cryptonote_stat_info.h:37
Definition: cryptonote_protocol_defs.h:224
void handler_response_blocks_now(size_t packet_size)
Definition: cryptonote_protocol_handler-base.cpp:125
core_stat_info stat_info
Definition: cryptonote_protocol_handler.h:78
virtual double get_avg_block_size()=0
Definition: cryptonote_protocol_defs.h:142
t_core & m_core
Definition: cryptonote_protocol_handler.h:136
nodetool::i_p2p_endpoint< connection_context > * m_p2p
Definition: cryptonote_protocol_handler.h:139
boost::mutex m_buffer_mutex
Definition: cryptonote_protocol_handler.h:147
Definition: cryptonote_protocol_defs.h:270
Definition: cryptonote_protocol_defs.h:251
Holds cryptonote related classes and helpers.
Definition: db_bdb.cpp:224
block_queue m_block_queue
Definition: cryptonote_protocol_handler.h:144
t_cryptonote_protocol_handler< t_core > cryptonote_protocol_handler
Definition: cryptonote_protocol_handler.h:79
Definition: cryptonote_protocol_defs.h:174
Definition: cryptonote_protocol_defs.h:247
Definition: cryptonote_protocol_handler.h:74
Definition: cryptonote_protocol_defs.h:178
std::atomic< bool > m_stopping
Definition: cryptonote_protocol_handler.h:142
Definition: cryptonote_protocol_defs.h:123
bool post_notify(typename t_parameter::request &arg, cryptonote_connection_context &context)
Definition: cryptonote_protocol_handler.h:152
Definition: cryptonote_protocol_defs.h:127
Definition: cryptonote_protocol_defs.h:210
Definition: cryptonote_protocol_defs.h:195
CORE_SYNC_DATA payload_type
Definition: cryptonote_protocol_handler.h:80
bool relay_post_notify(typename t_parameter::request &arg, cryptonote_connection_context &exclude_context)
Definition: cryptonote_protocol_handler.h:162
Definition: cryptonote_protocol_handler.h:59
std::atomic< bool > m_synchronized
Definition: cryptonote_protocol_handler.h:141
std::string blobdata
Definition: blobdatatype.h:35
boost::mutex m_sync_lock
Definition: cryptonote_protocol_handler.h:143
Definition: cryptonote_protocol_defs.h:228
int bool
Definition: stdbool.h:35
cryptonote_protocol_handler_base()
Definition: cryptonote_protocol_handler-base.cpp:116
DISABLE_VS_WARNINGS(4244 4345 4503) using namespace crypto
bool is_synchronized()
Definition: cryptonote_protocol_handler.h:106
Definition: cryptonote_protocol_defs.h:158
Definition: cryptonote_protocol_defs.h:266
Definition: cryptonote_protocol_defs.h:146
const char * name
Definition: simplewallet.cpp:319
Definition: cryptonote_protocol_defs.h:214
Definition: cryptonote_protocol_handler_common.h:41