From 5453e66fd91c303d04004d861ecad183ff177823 Mon Sep 17 00:00:00 2001 From: Ryan Ofsky Date: Thu, 19 Dec 2019 18:00:04 -0500 Subject: [PATCH] Fix nonsensical -noseednode behavior Treat specifying -noseednode the same as not specifying any -seednode value, instead of enabling the seed node timeout and log messages, and waiting longer to add other seeds. --- src/net.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/net.cpp b/src/net.cpp index c722ddfcb5f..9d42bafb559 100644 --- a/src/net.cpp +++ b/src/net.cpp @@ -2246,7 +2246,7 @@ void CConnman::ThreadDNSAddressSeed() { int outbound_connection_count = 0; - if (gArgs.IsArgSet("-seednode")) { + if (!gArgs.GetArgs("-seednode").empty()) { auto start = NodeClock::now(); constexpr std::chrono::seconds SEEDNODE_TIMEOUT = 30s; LogPrintf("-seednode enabled. Trying the provided seeds for %d seconds before defaulting to the dnsseeds.\n", SEEDNODE_TIMEOUT.count()); @@ -2549,7 +2549,7 @@ void CConnman::ThreadOpenConnections(const std::vector connect, Spa auto next_extra_network_peer{start + rng.rand_exp_duration(EXTRA_NETWORK_PEER_INTERVAL)}; const bool dnsseed = gArgs.GetBoolArg("-dnsseed", DEFAULT_DNSSEED); bool add_fixed_seeds = gArgs.GetBoolArg("-fixedseeds", DEFAULT_FIXEDSEEDS); - const bool use_seednodes{gArgs.IsArgSet("-seednode")}; + const bool use_seednodes{!gArgs.GetArgs("-seednode").empty()}; auto seed_node_timer = NodeClock::now(); bool add_addr_fetch{addrman.Size() == 0 && !seed_nodes.empty()};