Make auto-connect peers retry indefinitely on initial connection failure

Previously, static peers configured with AutoConnect gave up after 6
attempts (1 initial + 5 retries). If the remote peer was offline at
startup, the node permanently abandoned the connection. The reconnect
path (after MMP link-dead) already retried indefinitely but only
activated after a peer had been previously connected.

Remove the reconnect parameter from schedule_retry() and always set
reconnect=true when creating retry entries, since only auto-connect
peers reach this code path. The 300s backoff cap prevents resource waste.
The max_retries=0 config still works as an explicit kill switch.
This commit is contained in:
Johnathan Corgan
2026-03-15 18:43:11 +00:00
parent 959134657f
commit 324535e76d
4 changed files with 22 additions and 22 deletions
+1 -1
View File
@@ -475,7 +475,7 @@ impl Node {
.duration_since(std::time::UNIX_EPOCH)
.map(|d| d.as_millis() as u64)
.unwrap_or(0);
self.schedule_retry(*pending.peer_identity.node_addr(), now_ms, false);
self.schedule_retry(*pending.peer_identity.node_addr(), now_ms);
}
}
}