Skip to content
This repository has been archived by the owner on Mar 7, 2023. It is now read-only.

Commit

Permalink
fix(Buy): only check on pending trades
Browse files Browse the repository at this point in the history
  • Loading branch information
Thore3 committed May 12, 2017
1 parent ae453d6 commit 9a0d9cc
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/wallet.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
});
}
Expand Down

0 comments on commit 9a0d9cc

Please sign in to comment.