From de4a87e5f8c4085ff13bceb73c146dfd7d02b734 Mon Sep 17 00:00:00 2001 From: Braydon Fuller Date: Tue, 5 Apr 2016 14:51:38 -0400 Subject: [PATCH] index: update bitcoind tx event handler --- lib/index.js | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/lib/index.js b/lib/index.js index 25ee41a..9354d50 100644 --- a/lib/index.js +++ b/lib/index.js @@ -181,14 +181,12 @@ InsightAPI.prototype.blockHandler = function(block, add, callback) { }); }; -InsightAPI.prototype.transactionHandler = function(txInfo) { - if(txInfo.mempool) { - var tx = Transaction().fromBuffer(txInfo.buffer); - tx = this.txController.transformInvTransaction(tx); +InsightAPI.prototype.transactionHandler = function(txBuffer) { + var tx = new Transaction().fromBuffer(txBuffer); + var result = this.txController.transformInvTransaction(tx); - for (var i = 0; i < this.subscriptions.inv.length; i++) { - this.subscriptions.inv[i].emit('tx', tx); - } + for (var i = 0; i < this.subscriptions.inv.length; i++) { + this.subscriptions.inv[i].emit('tx', result); } };