mirror of
https://github.com/mempool/mempool.git
synced 2025-09-26 21:47:10 +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);
|
this.latestPrices.time = Math.round(new Date().getTime() / 1000);
|
||||||
logger.info(`Latest BTC fiat averaged price: ${JSON.stringify(this.latestPrices)}`);
|
logger.info(`Latest BTC fiat averaged price: ${JSON.stringify(this.latestPrices)}`);
|
||||||
|
|
||||||
if (this.ratesChangedCallback) {
|
|
||||||
this.ratesChangedCallback(this.latestPrices);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!forceUpdate) {
|
if (!forceUpdate) {
|
||||||
this.cyclePosition++;
|
this.cyclePosition++;
|
||||||
}
|
}
|
||||||
@@ -284,6 +280,10 @@ class PriceUpdater {
|
|||||||
if (this.latestPrices.USD === -1) {
|
if (this.latestPrices.USD === -1) {
|
||||||
this.latestPrices = await PricesRepository.$getLatestConversionRates();
|
this.latestPrices = await PricesRepository.$getLatestConversionRates();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (this.ratesChangedCallback) {
|
||||||
|
this.ratesChangedCallback(this.latestPrices);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Reference in New Issue
Block a user