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(); };