mirror of
https://github.com/monero-project/monero.git
synced 2025-12-10 10:17:11 -05:00
Merge pull request #2149
158c3ecfcore: thread most of handle_incoming_tx (moneromooo-monero)f57ee382cryptonote_protocol: retry stale spans early (moneromooo-monero)90df52e1cryptonote_protocol: light cleanup (moneromooo-monero)84e23156cryptonote_protocol: avoid spurious SYNCHRONIZED OK messages (moneromooo-monero)5be43fcdcryptonote_protocol_handler: sync speedup (moneromooo-monero)
This commit is contained in:
commit
6db8a60a18
26 changed files with 1616 additions and 186 deletions
|
|
@ -189,6 +189,7 @@ namespace nodetool
|
|||
virtual bool drop_connection(const epee::net_utils::connection_context_base& context);
|
||||
virtual void request_callback(const epee::net_utils::connection_context_base& context);
|
||||
virtual void for_each_connection(std::function<bool(typename t_payload_net_handler::connection_context&, peerid_type, uint32_t)> f);
|
||||
virtual bool for_connection(const boost::uuids::uuid&, std::function<bool(typename t_payload_net_handler::connection_context&, peerid_type, uint32_t)> f);
|
||||
virtual bool add_host_fail(const epee::net_utils::network_address &address);
|
||||
//----------------- i_connection_filter --------------------------------------------------------
|
||||
virtual bool is_remote_host_allowed(const epee::net_utils::network_address &address);
|
||||
|
|
|
|||
|
|
@ -200,6 +200,14 @@ namespace nodetool
|
|||
}
|
||||
//-----------------------------------------------------------------------------------
|
||||
template<class t_payload_net_handler>
|
||||
bool node_server<t_payload_net_handler>::for_connection(const boost::uuids::uuid &connection_id, std::function<bool(typename t_payload_net_handler::connection_context&, peerid_type, uint32_t)> f)
|
||||
{
|
||||
return m_net_server.get_config_object().for_connection(connection_id, [&](p2p_connection_context& cntx){
|
||||
return f(cntx, cntx.peer_id, cntx.support_flags);
|
||||
});
|
||||
}
|
||||
//-----------------------------------------------------------------------------------
|
||||
template<class t_payload_net_handler>
|
||||
bool node_server<t_payload_net_handler>::is_remote_host_allowed(const epee::net_utils::network_address &address)
|
||||
{
|
||||
CRITICAL_REGION_LOCAL(m_blocked_hosts_lock);
|
||||
|
|
|
|||
|
|
@ -51,6 +51,7 @@ namespace nodetool
|
|||
virtual void request_callback(const epee::net_utils::connection_context_base& context)=0;
|
||||
virtual uint64_t get_connections_count()=0;
|
||||
virtual void for_each_connection(std::function<bool(t_connection_context&, peerid_type, uint32_t)> f)=0;
|
||||
virtual bool for_connection(const boost::uuids::uuid&, std::function<bool(t_connection_context&, peerid_type, uint32_t)> f)=0;
|
||||
virtual bool block_host(const epee::net_utils::network_address &address, time_t seconds = 0)=0;
|
||||
virtual bool unblock_host(const epee::net_utils::network_address &address)=0;
|
||||
virtual std::map<std::string, time_t> get_blocked_hosts()=0;
|
||||
|
|
@ -88,6 +89,10 @@ namespace nodetool
|
|||
{
|
||||
|
||||
}
|
||||
virtual bool for_connection(const boost::uuids::uuid&, std::function<bool(t_connection_context&,peerid_type,uint32_t)> f)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
virtual uint64_t get_connections_count()
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue