SimpleCoin
SimpleCoin copied to clipboard
Add new peer nodes dynamically
Apart from having a few hard coded nodes, there should be a simple system that add new trusted peer nodes.
Something simple:
peers = []
nodes = initial_nodes
while len(peers) < number_of_peers_needed: # keep going till you find your peers
new_nodes = [] # recreate list of nodes to check
For node in nodes: # for each of those nodes
if random.random() < .1: # randomly pick those to add as a peer
peers.append(node)
else: # if you don't pick that node, check all of their peers
new_nodes.append( node.peers() )
nodes = new_nodes
I can submit a pull request for this
*dynamically
I also think this should be added, like it works with bitcoin.