From d177194bd248e91d977eca204db6bdeae5ce3e41 Mon Sep 17 00:00:00 2001 From: Christopher Jeffrey Date: Thu, 15 May 2014 01:17:21 -0500 Subject: [PATCH] update: use `addr` event to add new peers. Signed-off-by: Fedor Indutny --- scripts/update.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/scripts/update.js b/scripts/update.js index b3bd7aa0..84d3c18e 100644 --- a/scripts/update.js +++ b/scripts/update.js @@ -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);