From eacb04f4f9dd1400bfcab91647fb79611d31946a Mon Sep 17 00:00:00 2001 From: Patrick Nagurny Date: Tue, 18 Aug 2015 16:16:07 -0400 Subject: [PATCH] fix block subscription --- lib/block.js | 1 + lib/db.js | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/block.js b/lib/block.js index e03d13fc..4d36af54 100644 --- a/lib/block.js +++ b/lib/block.js @@ -50,6 +50,7 @@ Block.fromBufferReader = function(br) { Block.prototype.toObject = Block.prototype.toJSON = function() { return { + hash: this.hash, version: this.version, prevHash: this.prevHash, merkleRoot: this.merkleRoot, diff --git a/lib/db.js b/lib/db.js index c41acf9e..cdb01423 100644 --- a/lib/db.js +++ b/lib/db.js @@ -234,7 +234,7 @@ DB.prototype.blockHandler = function(block, add, callback) { // Notify block subscribers for(var i = 0; i < this.subscriptions.block.length; i++) { - this.subscriptions.transaction[i].emit('block', block.hash); + this.subscriptions.block[i].emit('block', block.hash); } async.eachSeries(