You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Nov 15, 2023. It is now read-only.
Avoid the 32-second "try to connect to some nodes" construct.
Instead:
Split the peer slots into three parts:
Reserved (peers that have been passed by the --reserved flag - they get their own special slots and should be continuously, though responsibly, (re)connected to)
Outgoing (number of slots == min_peers, these are connections to nodes that we discover/remember and initiate)
Incoming (number of slots == max_peers - min_peers, these are inbound connections from nodes that have discovered us)
Regarding Outgoing peers:
We start by connecting to up to min_peers nodes; they each take a slot in our Outgoing peer table.
We attempt to connect to a (/the highest scoring, once reputation system is done) node when one of the following happens:
A previous connection to a node has failed.
A peer who was in the Outgoing table has been/become disconnected.
We have discovered new nodes and have slots free in the Outgoing peer table.
The backoff timer of a previous node has expired and we can retry connecting.