Skip to content

Better peer culling

Luke Champine requested to merge gateway into master

makeOutboundConnections has been split into two functions, peerManager and nodeManager.

peerManager keeps the gateway well-connected by forming new connections to peers until reaching 8 total connections.

nodeManager keeps the node list healthy by pinging nodes and aggressively culling those that are unresponsive.

Tests pass, and coverage is okay, but these functions really ought to be tested in the wild. My guess is that it will take longer to get peers now. makeOutboundConnections tried to form up to 100 connections before sleeping; peerManager only tries to form one. However, these changes should (eventually) improve the average node list, such that fewer connection attempts are needed.

Merge request reports