try to reseed again after 30 second if failed

This commit is contained in:
orignal
2026-04-26 15:17:57 -04:00
parent f618e417db
commit 52da7fe59c
2 changed files with 20 additions and 4 deletions
+17 -3
View File
@@ -75,9 +75,23 @@ namespace data
}
else // bootstrap from reseed servers
{
int num = ReseedFromServers ();
if (num == 0)
LogPrint (eLogWarning, "Reseed: Failed to reseed from servers");
auto start = i2p::util::GetMonotonicSeconds ();
int num = 0;
while (!num)
{
num = ReseedFromServers ();
if (num) break; // success
if (i2p::util::GetMonotonicSeconds () < start + RESEED_GIVEUP_TIMEOUT)
{
LogPrint (eLogWarning, "Reseed: Failed to reseed from servers. Waiting for ", RESEED_WAITING_INTERVAL, " seconds");
std::this_thread::sleep_for (std::chrono::seconds(RESEED_WAITING_INTERVAL));
}
else
break; // give up
}
if (!num)
LogPrint (eLogWarning, "Reseed: Failed to reseed from servers. Give up");
}
}