index: update bitcoind tx event handler
This commit is contained in:
parent
b18dc95755
commit
de4a87e5f8
12
lib/index.js
12
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);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user