diff options
author | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2020-01-07 14:38:31 +0000 |
---|---|---|
committer | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2020-01-07 14:40:26 +0000 |
commit | a84131cea3b600773d1a108421a12c0adfc476cc (patch) | |
tree | f1342e2030f65009a5248c9da8a5821b2b086bc5 /src/p2p/net_node.inl | |
parent | Merge pull request #6232 (diff) | |
download | monero-a84131cea3b600773d1a108421a12c0adfc476cc.tar.xz |
p2p: fix off by one adding fallback peers
The code would ignore the first one to be added
Diffstat (limited to 'src/p2p/net_node.inl')
-rw-r--r-- | src/p2p/net_node.inl | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/p2p/net_node.inl b/src/p2p/net_node.inl index 45bb10593..fd2fcde55 100644 --- a/src/p2p/net_node.inl +++ b/src/p2p/net_node.inl @@ -1555,14 +1555,14 @@ namespace nodetool if (!m_fallback_seed_nodes_added) { MWARNING("Failed to connect to any of seed peers, trying fallback seeds"); - current_index = m_seed_nodes.size(); + current_index = m_seed_nodes.size() - 1; for (const auto &peer: get_seed_nodes(m_nettype)) { MDEBUG("Fallback seed node: " << peer); append_net_address(m_seed_nodes, peer, cryptonote::get_config(m_nettype).P2P_DEFAULT_PORT); } m_fallback_seed_nodes_added = true; - if (current_index == m_seed_nodes.size()) + if (current_index == m_seed_nodes.size() - 1) { MWARNING("No fallback seeds, continuing without seeds"); break; |