update: use addr event to add new peers.
Signed-off-by: Fedor Indutny <fedor@indutny.com>
This commit is contained in:
parent
24779fb398
commit
d177194bd2
@ -37,6 +37,12 @@ pool.on('block', function(block) {
|
|||||||
pool.request.queue.length);
|
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);
|
pool.once('full', finish);
|
||||||
process.once('SIGINT', finish);
|
process.once('SIGINT', finish);
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user