bitpay / bitcore-p2p

Interface to the bitcoin P2P network for bitcore
MIT License
80 stars 276 forks source link

Pool connected event #41

Open braydonf opened 9 years ago

braydonf commented 9 years ago

When calling pool.connect() there should be an event other than 'peerready' that is emitted, when all connections are filled (as 'ready' can happen before the peer is added to the _connectedPeers object in tests).

var pool = Pool();
pool.on('connected', function() {
  // send message to peers
});
pool.connect();
maraoz commented 9 years ago

I would call the event 'maxed' or 'full', given most use cases won't care about connecting to ALL peers in a list (thus 'connected' seems misguiding IMO)

braydonf commented 9 years ago

Sounds good! fullyconnected perhaps.