From 835ab3b61795987c1d6f5b9f509903f86058081f Mon Sep 17 00:00:00 2001 From: Chris Kleeschulte Date: Fri, 12 May 2017 13:03:51 -0400 Subject: [PATCH] Made local transform stream. --- lib/services/wallet-api/index.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/services/wallet-api/index.js b/lib/services/wallet-api/index.js index 19595310..bc151e70 100644 --- a/lib/services/wallet-api/index.js +++ b/lib/services/wallet-api/index.js @@ -17,7 +17,6 @@ var LRU = require('lru-cache'); var Encoding = require('./encoding'); var Input = require('bitcore-lib').Transaction.Input; var Transform = require('stream').Transform; -var transform = new Transform({ objectMode: true, highWaterMark: 1000000 }); var WalletService = function(options) { BaseService.call(this, options); @@ -664,6 +663,7 @@ WalletService.prototype._endpointGetTransactions = function() { walletId: walletId }; + var transform = new Transform({ objectMode: true, highWaterMark: 1000000 }); //txids are sent in and the actual tx's are found here transform._transform = function(chunk, enc, callback) { @@ -686,7 +686,6 @@ WalletService.prototype._endpointGetTransactions = function() { }; transform._flush = function(callback) { - stream.unpipe(transform); self.db.resumeSync(); callback(); };