fix block subscription

This commit is contained in:
Patrick Nagurny 2015-08-18 16:16:07 -04:00
parent d6d9c6a975
commit eacb04f4f9
2 changed files with 2 additions and 1 deletions

View File

@ -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,

View File

@ -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(