Merge pull request #5999 from mempool/natsoni/fix-rates

Fix websocket price data
This commit is contained in:
nymkappa
2025-08-07 19:27:02 +02:00
committed by GitHub
2 changed files with 7 additions and 7 deletions

View File

@@ -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);
}
}

View File

@@ -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 || {};