Fix swarm bootstrap for logo-less nodes

This commit is contained in:
cyph3rasi
2026-03-07 20:54:30 -08:00
parent 2acebc15a5
commit 853c564755
3 changed files with 32 additions and 2 deletions
+12
View File
@@ -64,9 +64,21 @@ async function runBotTasks() {
async function runSwarmGossip() {
try {
const stats = await getSwarmStats();
// Recover from empty peer lists by periodically re-announcing to seeds.
if (stats.activeNodes === 0) {
const announceResult = await announceToSeeds();
if (announceResult.successful.length > 0 || announceResult.failed.length > 0) {
log('SWARM', `Re-announced to seeds: ${announceResult.successful.length} successful, ${announceResult.failed.length} failed`);
}
}
const result = await runGossipRound();
if (result.contacted > 0) {
log('SWARM', `Gossip: contacted ${result.contacted}, successful ${result.successful}, received ${result.totalNodesReceived} nodes`);
} else if (stats.activeNodes === 0) {
log('SWARM', 'No active swarm peers yet');
}
} catch (error) {
log('SWARM', `Gossip error: ${error}`);