From f8fccb8eaf8a52997ec49e0b13ed92b7a30db8cd Mon Sep 17 00:00:00 2001 From: Christopher Jeffrey Date: Mon, 27 Oct 2014 14:58:03 -0700 Subject: [PATCH] fix parsed again. emit digest. --- example/index.js | 4 ++-- lib/bitcoind.js | 13 +++++-------- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/example/index.js b/example/index.js index 4d508dba..fe91222f 100755 --- a/example/index.js +++ b/example/index.js @@ -205,9 +205,9 @@ bitcoind.on('open', function(status) { return; } - // Test all parsed packets: + // Test all digest packets: if (argv['packets']) { - bitcoind.on('parsed', function(packet) { + bitcoind.on('digest', function(packet) { return bitcoind.log(packet); }); return; diff --git a/lib/bitcoind.js b/lib/bitcoind.js index b4937bdc..d3fc3204 100644 --- a/lib/bitcoind.js +++ b/lib/bitcoind.js @@ -162,19 +162,19 @@ Bitcoin.prototype.start = function(options, callback) { if (packet.name === 'addr') { self.emit(packet.name, packet.addresses); - self.emit('parsed', packet.addresses); + self.emit('digest', packet.addresses); return; } if (packet.name === 'block') { var block = self.block(packet.block); self.emit(packet.name, block); - self.emit('parsed', block); + self.emit('digest', block); block.tx.forEach(function(tx) { setImmediate(function() { tx = self.tx(tx); self.emit('tx', tx); - self.emit('parsed', tx); + self.emit('digest', tx); }); }); return; @@ -187,15 +187,12 @@ Bitcoin.prototype.start = function(options, callback) { name = 'mptx'; } self.emit(name, tx); - self.emit('parsed', tx); + self.emit('digest', tx); return; } self.emit(packet.name, packet); - self.emit('parsed', - packet.addresses - || packet.block - || packet.tx); + self.emit('digest', packet); }); }); }, 50);