mirror of
https://github.com/mempool/mempool.git
synced 2025-09-21 17:09:43 +02:00
Update conversions rates before sending them to websocket
This commit is contained in:
@@ -273,10 +273,6 @@ class PriceUpdater {
|
||||
this.latestPrices.time = Math.round(new Date().getTime() / 1000);
|
||||
logger.info(`Latest BTC fiat averaged price: ${JSON.stringify(this.latestPrices)}`);
|
||||
|
||||
if (this.ratesChangedCallback) {
|
||||
this.ratesChangedCallback(this.latestPrices);
|
||||
}
|
||||
|
||||
if (!forceUpdate) {
|
||||
this.cyclePosition++;
|
||||
}
|
||||
@@ -284,6 +280,10 @@ class PriceUpdater {
|
||||
if (this.latestPrices.USD === -1) {
|
||||
this.latestPrices = await PricesRepository.$getLatestConversionRates();
|
||||
}
|
||||
|
||||
if (this.ratesChangedCallback) {
|
||||
this.ratesChangedCallback(this.latestPrices);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user