update: use addr event to add new peers.

Signed-off-by: Fedor Indutny <fedor@indutny.com>
This commit is contained in:
Christopher Jeffrey 2014-05-15 01:17:21 -05:00 committed by Fedor Indutny
parent 24779fb398
commit d177194bd2

View File

@ -37,6 +37,12 @@ pool.on('block', function(block) {
pool.request.queue.length);
});
pool.on('addr', function(data) {
if (data.port !== 8333) return;
console.log('Found new peer: %s', data.host);
addrs.push(data.address);
});
pool.once('full', finish);
process.once('SIGINT', finish);