From 9a0d9ccd0bb112b85d8f5df02738f2aa23891eb7 Mon Sep 17 00:00:00 2001 From: Justin Tormey Date: Fri, 12 May 2017 17:28:14 -0400 Subject: [PATCH] fix(Buy): only check on pending trades --- src/wallet.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/wallet.js b/src/wallet.js index bef8d0fa3..56f18dadd 100644 --- a/src/wallet.js +++ b/src/wallet.js @@ -223,9 +223,9 @@ MyWallet.checkForCompletedTrades = function (stringWallet, stringExternal, magic exchange.debug = true; let trades = exchange.trades; if (trades.length) { - let watchTrade = (t) => t.watchAddress().then(() => callback(t)); - trades.filter(t => !t.bitcoinReceived).forEach(watchTrade); - exchange._TradeClass._checkOnce(trades, exchange._delegate).then(() => { + let pendingTrades = trades.filter(t => !t.bitcoinReceived); + pendingTrades.forEach((t) => t.watchAddress().then(() => callback(t))); + exchange._TradeClass._checkOnce(pendingTrades, exchange._delegate).then(() => { external.save(); }); }