aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAlexander Blair <snipa@jagtech.io>2020-03-27 12:17:53 -0700
committerAlexander Blair <snipa@jagtech.io>2020-03-27 12:17:54 -0700
commitc038cc8b791ffb4bcd5f13e47de1ea98815059fe (patch)
tree9b51318a9a7707ab040426827d8224821a011f36 /src
parentMerge pull request #6279 (diff)
parentp2p: fix spurious warning when we're connected to at last one seed (diff)
downloadmonero-c038cc8b791ffb4bcd5f13e47de1ea98815059fe.tar.xz
Merge pull request #6280
b818522d p2p: fix spurious warning when we're connected to at last one seed (moneromooo-monero)
Diffstat (limited to 'src')
-rw-r--r--src/p2p/net_node.inl10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/p2p/net_node.inl b/src/p2p/net_node.inl
index 3f7edf9b1..dec652054 100644
--- a/src/p2p/net_node.inl
+++ b/src/p2p/net_node.inl
@@ -1533,6 +1533,7 @@ namespace nodetool
return true;
size_t try_count = 0;
+ bool is_connected_to_at_least_one_seed_node = false;
size_t current_index = crypto::rand_idx(m_seed_nodes.size());
const net_server& server = m_network_zones.at(epee::net_utils::zone::public_).m_net_server;
while(true)
@@ -1540,7 +1541,11 @@ namespace nodetool
if(server.is_stop_signal_sent())
return false;
- if(try_to_connect_and_handshake_with_new_peer(m_seed_nodes[current_index], true))
+ peerlist_entry pe_seed{};
+ pe_seed.adr = m_seed_nodes[current_index];
+ if (is_peer_used(pe_seed))
+ is_connected_to_at_least_one_seed_node = true;
+ else if (try_to_connect_and_handshake_with_new_peer(m_seed_nodes[current_index], true))
break;
if(++try_count > m_seed_nodes.size())
{
@@ -1563,7 +1568,8 @@ namespace nodetool
}
else
{
- MWARNING("Failed to connect to any of seed peers, continuing without seeds");
+ if (!is_connected_to_at_least_one_seed_node)
+ MWARNING("Failed to connect to any of seed peers, continuing without seeds");
break;
}
}