38 #include <boost/program_options/variables_map.hpp> 42 #include "math_helper.h" 43 #include "storages/levin_abstract_invoke2.h" 52 #include <boost/circular_buffer.hpp> 57 #define LOCALHOST_INT 2130706433 58 #define CURRENCY_PROTOCOL_MAX_OBJECT_REQUEST_COUNT 500 63 class cryptonote_protocol_handler_base_pimpl;
66 std::unique_ptr<cryptonote_protocol_handler_base_pimpl>
mI;
78 template<class t_core>
90 HANDLE_NOTIFY_T2(
NOTIFY_NEW_BLOCK, &cryptonote_protocol_handler::handle_notify_new_block)
103 bool init(const
boost::program_options::variables_map& vm);
108 bool get_payload_sync_data(
blobdata& data);
112 t_core& get_core(){
return m_core;}
114 void log_connections();
115 std::list<connection_info> get_connections();
135 virtual bool request_validators_list_to_all();
140 size_t get_synchronizing_connections_count();
141 bool on_connection_synchronized();
144 bool kick_idle_peers();
160 boost::circular_buffer<size_t> m_avg_buffer = boost::circular_buffer<size_t>(10);
162 template<
class t_parameter>
165 LOG_PRINT_L2(
"[" << epee::net_utils::print_connection_context_short(
context) <<
"] post " <<
typeid(t_parameter).
name() <<
" -->");
167 epee::serialization::store_t_to_binary(
arg, blob);
172 template<
class t_parameter>
175 LOG_PRINT_L2(
"[" << epee::net_utils::print_connection_context_short(exclude_context) <<
"] post relay " <<
typeid(t_parameter).
name() <<
" -->");
176 std::string arg_buff;
177 epee::serialization::store_t_to_binary(
arg, arg_buff);
Definition: cryptonote_protocol_defs.h:165
nodetool::p2p_endpoint_stub< connection_context > m_p2p_stub
Definition: cryptonote_protocol_handler.h:149
epee::math_helper::once_a_time_seconds< 30 > m_idle_peer_kicker
Definition: cryptonote_protocol_handler.h:156
void handler_request_blocks_history(std::list< crypto::hash > &ids)
Definition: cryptonote_protocol_handler-base.cpp:123
Definition: cryptonote_protocol_defs.h:304
Definition: block_queue.h:47
virtual double estimate_one_block_size() noexcept
Definition: cryptonote_protocol_handler-base.cpp:105
PUSH_WARNINGS
Definition: hash-ops.h:54
std::unique_ptr< cryptonote_protocol_handler_base_pimpl > mI
Definition: cryptonote_protocol_handler.h:66
Definition: unordered_containers_boost_serialization.h:38
const block_queue & get_block_queue() const
Definition: cryptonote_protocol_handler.h:116
Definition: cryptonote_protocol_defs.h:298
cryptonote_connection_context connection_context
Definition: cryptonote_protocol_handler.h:82
std::atomic< uint32_t > m_syncronized_connections_count
Definition: cryptonote_protocol_handler.h:151
virtual ~cryptonote_protocol_handler_base()
Definition: cryptonote_protocol_handler-base.cpp:120
Definition: connection_context.h:41
Definition: cryptonote_stat_info.h:38
Definition: cryptonote_protocol_defs.h:227
void handler_response_blocks_now(size_t packet_size)
Definition: cryptonote_protocol_handler-base.cpp:126
core_stat_info stat_info
Definition: cryptonote_protocol_handler.h:83
virtual double get_avg_block_size()=0
Definition: cryptonote_protocol_defs.h:145
t_core & m_core
Definition: cryptonote_protocol_handler.h:147
nodetool::i_p2p_endpoint< connection_context > * m_p2p
Definition: cryptonote_protocol_handler.h:150
boost::mutex m_buffer_mutex
Definition: cryptonote_protocol_handler.h:158
Definition: cryptonote_protocol_defs.h:275
Definition: cryptonote_protocol_defs.h:254
Holds cryptonote related classes and helpers.
Definition: db_bdb.cpp:225
block_queue m_block_queue
Definition: cryptonote_protocol_handler.h:155
t_cryptonote_protocol_handler< t_core > cryptonote_protocol_handler
Definition: cryptonote_protocol_handler.h:84
Definition: cryptonote_protocol_defs.h:177
Definition: cryptonote_protocol_defs.h:250
Definition: cryptonote_protocol_handler.h:79
Definition: cryptonote_protocol_defs.h:181
std::atomic< bool > m_stopping
Definition: cryptonote_protocol_handler.h:153
DISABLE_VS_WARNINGS(4244 4345 4503) namespace cryptonote
Definition: tx_pool.cpp:53
Definition: cryptonote_protocol_defs.h:124
bool post_notify(typename t_parameter::request &arg, cryptonote_connection_context &context)
Definition: cryptonote_protocol_handler.h:163
Definition: cryptonote_protocol_defs.h:128
Definition: cryptonote_protocol_defs.h:213
Definition: cryptonote_protocol_defs.h:198
CORE_SYNC_DATA payload_type
Definition: cryptonote_protocol_handler.h:85
bool relay_post_notify(typename t_parameter::request &arg, cryptonote_connection_context &exclude_context)
Definition: cryptonote_protocol_handler.h:173
Definition: cryptonote_protocol_handler.h:64
std::atomic< bool > m_synchronized
Definition: cryptonote_protocol_handler.h:152
std::string blobdata
Definition: blobdatatype.h:36
internal::NamedArgWithType< char, T > arg(StringRef name, const T &arg)
Definition: format.h:3450
Definition: cryptonote_protocol_defs.h:325
boost::mutex m_sync_lock
Definition: cryptonote_protocol_handler.h:154
Definition: cryptonote_protocol_defs.h:231
int bool
Definition: stdbool.h:36
Definition: cryptonote_protocol_defs.h:294
cryptonote_protocol_handler_base()
Definition: cryptonote_protocol_handler-base.cpp:117
bool is_synchronized()
Definition: cryptonote_protocol_handler.h:113
Definition: cryptonote_protocol_defs.h:161
Definition: cryptonote_protocol_defs.h:271
Definition: cryptonote_protocol_defs.h:149
const char * name
Definition: simplewallet.cpp:180
This is the orginal cryptonote protocol network-events handler, modified by us.
Definition: cryptonote_protocol_defs.h:321
Definition: cryptonote_protocol_defs.h:217
Definition: cryptonote_protocol_handler_common.h:42
json::wvalue context
Definition: mustache.h:12