Market api: Fix memory leak

This commit is contained in:
softsimon 2020-09-15 23:12:42 +07:00
parent 344413568d
commit 4d4eaecb87
No known key found for this signature in database
GPG Key ID: 488D7DCFB5A430D7

View File

@ -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]) {