Market api: Fix memory leak
This commit is contained in:
parent
344413568d
commit
4d4eaecb87
@ -20,11 +20,13 @@ class BisqMarketsApi {
|
|||||||
this.tradesData = trades;
|
this.tradesData = trades;
|
||||||
|
|
||||||
// Handle data for smarter memory caching
|
// Handle data for smarter memory caching
|
||||||
|
this.fiatCurrenciesIndexed = {};
|
||||||
this.fiatCurrencyData.forEach((currency) => {
|
this.fiatCurrencyData.forEach((currency) => {
|
||||||
currency._type = 'fiat';
|
currency._type = 'fiat';
|
||||||
this.fiatCurrenciesIndexed[currency.code] = true;
|
this.fiatCurrenciesIndexed[currency.code] = true;
|
||||||
});
|
});
|
||||||
this.cryptoCurrencyData.forEach((currency) => currency._type = 'crypto');
|
this.cryptoCurrencyData.forEach((currency) => currency._type = 'crypto');
|
||||||
|
this.tradeDataByMarket = {};
|
||||||
this.tradesData.forEach((trade) => {
|
this.tradesData.forEach((trade) => {
|
||||||
trade._market = trade.currencyPair.toLowerCase().replace('/', '_');
|
trade._market = trade.currencyPair.toLowerCase().replace('/', '_');
|
||||||
if (!this.tradeDataByMarket[trade._market]) {
|
if (!this.tradeDataByMarket[trade._market]) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user