In the function connections_maker
in net_node.inl
a node selects the peers to which it tries to create a connection. This computation seems to be important in which order we select the peers: either from anchor list, white list and grey list or from grey list and white list. However, I have some troubles to figure out when we select which order. Can anybody explain that?
-
Possible duplicate of How does a node maintain its anchor peer list?– jtgrassieCommented May 20, 2019 at 11:08
Add a comment
|
1 Answer
Anchor first, then white, then gray.
-
Yes, I agree. But there is an
else
branch: grey list and then white list. My question is when do we take thiselse
branch? Commented May 20, 2019 at 17:03 -
1That else branch is hit if we have exhausted our expected white connection count, so it then tries some grays. If we specified we wanted to maintain a total of 10 outgoing peers, and of those, we wanted to say try 3 whites, once we have 3 whites connected, then try the grays. Commented May 21, 2019 at 0:27