icook / pynode2

A rework of Jeff Garzik's PyNode
MIT License
13 stars 2 forks source link

Run a thread that manages node connections #8

Open icook opened 9 years ago

icook commented 9 years ago

Right now we just connect to the seed nodes and leave it at that. A thread to manage node connections should be added.

Responsibilities might roughly include:

Some possible optimizations that could be done on node connection management:

  1. Try to maintain some small number of rotating connections that we will briefly connect to in order to map the network, find ping times, geolocate, etc. IE, we occasionally disconnect from some in this pool and try finding new connections to replace them, and while connected we don't really run getblocks and mempool.
  2. Select a more diverse set of peers based on geolocation and ping time. This will aid in network propogation.
  3. Actively track blockheight/hash of peers and try to maintain at least X number of peers that are on the same blockheight. In the bad Darkcoin forks there were issues with the clients maxconns getting filled with clients that were forked.