Commit a85dbc91 authored by TyphooN's avatar TyphooN

Merge branch 'next' into 'master'

Next rollup

See merge request !89
parents eff45037 c3fd881e
Pipeline #82817527 passed with stages
in 115 minutes and 28 seconds
FROM debian:stable
RUN apt-get update && apt-get install -y unzip automake build-essential curl file pkg-config git python libtool libtinfo5
RUN apt-get update && apt-get install -y unzip automake build-essential curl file pkg-config git python libtool libtinfo5 zip
WORKDIR /opt/android
## INSTALL ANDROID SDK
......
......@@ -332,7 +332,6 @@ namespace nodetool
bool connections_maker();
bool peer_sync_idle_maker();
bool do_request_peer_id(peerid_type& pi, p2p_connection_context& context, bool just_take_peerlist = false);
bool do_handshake_with_peer(peerid_type& pi, p2p_connection_context& context, bool just_take_peerlist = false);
bool do_peer_timed_sync(const epee::net_utils::connection_context_base& context, peerid_type peer_id);
......
......@@ -779,37 +779,6 @@ namespace nodetool
return true;
}
//-----------------------------------------------------------------------------------
template<class t_payload_net_handler>
bool node_server<t_payload_net_handler>::do_request_peer_id(peerid_type& pi, p2p_connection_context& context_, bool just_take_peerlist)
{
typename COMMAND_REQUEST_PEER_ID::request arg;
typename COMMAND_REQUEST_PEER_ID::response rsp;
epee::simple_event ev;
std::atomic<bool> hsh_result(true);
network_zone& zone = m_network_zones.at(context_.m_remote_address.get_zone());
bool r = epee::net_utils::async_invoke_remote_command2<typename COMMAND_REQUEST_PEER_ID::response>(context_.m_connection_id, COMMAND_REQUEST_PEER_ID::ID, arg, zone.m_net_server.get_config_object(),
[this, &ev, &hsh_result](int code, const typename COMMAND_REQUEST_PEER_ID::response& rsp, p2p_connection_context& context)
{
epee::misc_utils::auto_scope_leave_caller scope_exit_handler = epee::misc_utils::create_scope_leave_handler([&](){ev.raise();});
if(code < 0)
{
LOG_WARNING_CC(context, "COMMAND_REQUEST_PEER_ID invoke failed. (" << code << ", " << epee::levin::get_err_descr(code) << ")");
hsh_result = false;
return;
}
}, P2P_DEFAULT_HANDSHAKE_INVOKE_TIMEOUT);
if (r)
ev.wait();
return hsh_result;
}
template<class t_payload_net_handler>
bool node_server<t_payload_net_handler>::do_handshake_with_peer(peerid_type& pi, p2p_connection_context& context_, bool just_take_peerlist)
{
......@@ -1060,15 +1029,7 @@ namespace nodetool
con->m_anchor = peer_type == anchor;
peerid_type pi = AUTO_VAL_INIT(pi);
bool res = do_request_peer_id(pi, *con, just_take_peerlist);
if (!res)
{
block_host(con->m_remote_address);
return false;
}
res = do_handshake_with_peer(pi, *con, just_take_peerlist);
bool res = do_handshake_with_peer(pi, *con, just_take_peerlist);
if(!res)
{
......@@ -1129,17 +1090,7 @@ namespace nodetool
con->m_anchor = false;
peerid_type pi = AUTO_VAL_INIT(pi);
bool res = do_request_peer_id(pi, *con, true);
if (!res)
{
block_host(con->m_remote_address);
return false;
}
res = do_handshake_with_peer(pi, *con, true);
const bool res = do_handshake_with_peer(pi, *con, true);
if (!res) {
bool is_priority = is_priority_node(na);
......@@ -2260,7 +2211,7 @@ namespace nodetool
if (address.get_zone() != epee::net_utils::zone::public_)
return false; // Unable to determine how many connections from host
const size_t max_connections = 1;
const size_t max_connections = 3;
size_t count = 0;
m_network_zones.at(epee::net_utils::zone::public_).m_net_server.get_config_object().foreach_connection([&](const p2p_connection_context& cntxt)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment