mirror of
https://seed.radicle.dev/rad:z3gqcJUoA1n9HaHKufZs5FCSGazv5.git
synced 2026-11-15 07:40:36 +08:00
When a connection drops and the node attempts to reconnect within the same second, the `last_attempt` timestamp written to the database is identitcal to the `last_success` timestamp due to the Unix time (seconds) precision loss. The `maintain_connections` logic filters eligible peers using the condition `last_success >= last_attempt`. Because the truncated timestamps are equal, this evaluates to true, causing the node to bypass the `CONNECTION_RETRY_DELTA` backoff. If the OS instantly rejects the dial attempt (e.g. `EHOSTUNREACH`), the node synchronously queues another connection attempt. This traps the reactor in an infinite `while` loop. Changing the condition to `last_success > last_attempt` ensures that a failed attempt in the same second correctly evaluates to false, forcing the node to respect the backoff timer and breaking the loop.