diff options
author | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2020-01-03 17:58:13 +0000 |
---|---|---|
committer | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2020-01-31 15:11:22 +0000 |
commit | b818522d29f9961dfba318f6979c6b8bffcb6e10 (patch) | |
tree | cb517fc21f469c80147be4664ddfba4ea3bb0306 /src/p2p/net_node.inl | |
parent | Merge pull request #6232 (diff) | |
download | monero-b818522d29f9961dfba318f6979c6b8bffcb6e10.tar.xz |
p2p: fix spurious warning when we're connected to at last one seed
Diffstat (limited to '')
-rw-r--r-- | src/p2p/net_node.inl | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/p2p/net_node.inl b/src/p2p/net_node.inl index 45bb10593..f5f587e17 100644 --- a/src/p2p/net_node.inl +++ b/src/p2p/net_node.inl @@ -1541,6 +1541,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) @@ -1548,7 +1549,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()) { @@ -1571,7 +1576,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; } } |