diff --git a/trader/trader.go b/trader/trader.go index 983a48617..1dd7925ac 100644 --- a/trader/trader.go +++ b/trader/trader.go @@ -400,19 +400,19 @@ func (t *Trader) update() bool { t.deleteAllOffers(false) return false } - } - // TODO 2 streamline the request data instead of caching - // reset cache of balances for this update cycle to reduce redundant requests to calculate asset balances - t.sdex.IEIF().ResetCachedBalances() - // reset and recompute cached liabilities for this update cycle - e = t.sdex.IEIF().ResetCachedLiabilities(t.assetBase, t.assetQuote) - log.Printf("liabilities after resetting\n") - t.sdex.IEIF().LogAllLiabilities(t.assetBase, t.assetQuote) - if e != nil { - log.Println(e) - t.deleteAllOffers(false) - return false + // TODO 2 streamline the request data instead of caching - may not need this since result of PruneOps is async + // reset cache of balances for this update cycle to reduce redundant requests to calculate asset balances + t.sdex.IEIF().ResetCachedBalances() + // reset and recompute cached liabilities for this update cycle + e = t.sdex.IEIF().ResetCachedLiabilities(t.assetBase, t.assetQuote) + log.Printf("liabilities after resetting\n") + t.sdex.IEIF().LogAllLiabilities(t.assetBase, t.assetQuote) + if e != nil { + log.Println(e) + t.deleteAllOffers(false) + return false + } } opsOld, e := t.strategy.UpdateWithOps(t.buyingAOffers, t.sellingAOffers)