As 25 seconds is a timeout for the early exit from dnsseed thread, we could do not introduce a new heuristic constant at all:
0--- a/src/net.cpp
1+++ b/src/net.cpp
2@@ -41,9 +41,9 @@
3 static_assert(MINIUPNPC_API_VERSION >= 10, "miniUPnPc API version >= 10 assumed");
4 #endif
5
6-#include <unordered_map>
7-
8+#include <chrono>
9 #include <math.h>
10+#include <unordered_map>
11
12 // Dump addresses to peers.dat every 15 minutes (900s)
13 static constexpr int DUMP_PEERS_INTERVAL = 15 * 60;
14@@ -1601,12 +1601,12 @@ void CConnman::ThreadDNSAddressSeed()
15 for (const std::string& seed : seeds) {
16 if (addrman.size() > 0 && seeds_right_now == 0) {
17 LogPrintf("Waiting %d seconds before querying DNS seeds.\n", seeds_wait_time.count());
18- std::chrono::seconds to_wait = seeds_wait_time;
19+ std::chrono::milliseconds to_wait{seeds_wait_time};
20 while (to_wait.count() > 0) {
21- std::chrono::seconds w{25}; // check for early abort every 25 seconds
22- if (w > to_wait) w = to_wait;
23- if (!interruptNet.sleep_for(w)) return;
24- to_wait -= w;
25+ std::chrono::milliseconds recheck_period{nConnectTimeout};
26+ if (recheck_period > to_wait) recheck_period = to_wait;
27+ if (!interruptNet.sleep_for(recheck_period)) return;
28+ to_wait -= recheck_period;
29
30 int nRelevant = 0;
31 {