mirror of
https://github.com/mempool/mempool.git
synced 2025-09-20 16:50:46 +02:00
Merge pull request #5999 from mempool/natsoni/fix-rates
Fix websocket price data
This commit is contained in:
@@ -271,11 +271,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++;
|
||||
@@ -283,6 +278,13 @@ class PriceUpdater {
|
||||
|
||||
if (this.latestPrices.USD === -1) {
|
||||
this.latestPrices = await PricesRepository.$getLatestConversionRates();
|
||||
logger.warn(`No BTC price available, falling back to latest known price: ${JSON.stringify(this.latestPrices)}`);
|
||||
} else {
|
||||
logger.info(`Latest BTC fiat averaged price: ${JSON.stringify(this.latestPrices)}`);
|
||||
}
|
||||
|
||||
if (this.ratesChangedCallback && this.latestPrices.USD > 0) {
|
||||
this.ratesChangedCallback(this.latestPrices);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -7,8 +7,6 @@ import { MempoolBlockViewComponent } from '@components/mempool-block-view/mempoo
|
||||
import { ClockComponent } from '@components/clock/clock.component';
|
||||
import { StatusViewComponent } from '@components/status-view/status-view.component';
|
||||
import { AddressGroupComponent } from '@components/address-group/address-group.component';
|
||||
import { TrackerComponent } from '@components/tracker/tracker.component';
|
||||
import { AccelerateCheckout } from '@components/accelerate-checkout/accelerate-checkout.component';
|
||||
import { TrackerGuard } from '@app/route-guards';
|
||||
|
||||
const browserWindow = window || {};
|
||||
|
Reference in New Issue
Block a user