From 4d4eaecb8721ce52ee800a13fa597866be26b14b Mon Sep 17 00:00:00 2001 From: softsimon Date: Tue, 15 Sep 2020 23:12:42 +0700 Subject: [PATCH] Market api: Fix memory leak --- backend/src/api/bisq/markets-api.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/backend/src/api/bisq/markets-api.ts b/backend/src/api/bisq/markets-api.ts index 8da17f482..670f88d73 100644 --- a/backend/src/api/bisq/markets-api.ts +++ b/backend/src/api/bisq/markets-api.ts @@ -20,11 +20,13 @@ class BisqMarketsApi { this.tradesData = trades; // Handle data for smarter memory caching + this.fiatCurrenciesIndexed = {}; this.fiatCurrencyData.forEach((currency) => { currency._type = 'fiat'; this.fiatCurrenciesIndexed[currency.code] = true; }); this.cryptoCurrencyData.forEach((currency) => currency._type = 'crypto'); + this.tradeDataByMarket = {}; this.tradesData.forEach((trade) => { trade._market = trade.currencyPair.toLowerCase().replace('/', '_'); if (!this.tradeDataByMarket[trade._market]) {