Avoid trusted seed retry blocking app startup

This commit is contained in:
thePR0M3TH3AN committed 2026-01-02 12:26:53 -05:00
1 parent 9310929f0d
commit 40e8f436e6
1 file changed
+13 -4
+13 -4
View File
@@ -144,18 +144,27 @@ async function bootstrapTrustedSeeds() {
}
};
let hydrateResult = await hydrate();
const hydrateResult = await hydrate();
const runAsyncRetry = async () => {
if (hydrateResult?.ok || attempts >= 2) {
return;
}
if (!hydrateResult?.ok && attempts < 2) {
const relaysReady = await waitForRelaysReady();
if (relaysReady) {
hydrateResult = await hydrate();
await hydrate();
} else {
devLogger.warn(
"[bootstrap] Skipping trusted seed retry because relays were not ready in time.",
);
applySeeds();
}
}
};
runAsyncRetry().catch((error) => {
userLogger.warn("[bootstrap] Trusted seed retry failed", error);
});
if (!hydrateResult?.ok) {
applySeeds();