Only fetch 1m mining stats

This commit is contained in:
natsoni 2024-09-19 14:54:54 +02:00
parent c13b8029d3
commit bb06a66a03
No known key found for this signature in database
GPG Key ID: C65917583181743B
2 changed files with 3 additions and 3 deletions

View File

@ -192,7 +192,7 @@ export class TransactionComponent implements OnInit, AfterViewInit, OnDestroy {
this.hideAccelerationSummary = this.stateService.isMempoolSpaceBuild ? this.storageService.getValue('hide-accelerator-pref') == 'true' : true; this.hideAccelerationSummary = this.stateService.isMempoolSpaceBuild ? this.storageService.getValue('hide-accelerator-pref') == 'true' : true;
if (!this.stateService.isLiquid()) { if (!this.stateService.isLiquid()) {
this.miningService.getMiningStats('1w').subscribe(stats => { this.miningService.getMiningStats('1m').subscribe(stats => {
this.miningStats = stats; this.miningStats = stats;
}); });
} }
@ -491,7 +491,7 @@ export class TransactionComponent implements OnInit, AfterViewInit, OnDestroy {
if (this.stateService.network === '') { if (this.stateService.network === '') {
if (!this.mempoolPosition.accelerated) { if (!this.mempoolPosition.accelerated) {
if (!this.accelerationFlowCompleted && !this.hideAccelerationSummary && !this.showAccelerationSummary) { if (!this.accelerationFlowCompleted && !this.hideAccelerationSummary && !this.showAccelerationSummary) {
this.miningService.getMiningStats('1w').subscribe(stats => { this.miningService.getMiningStats('1m').subscribe(stats => {
this.miningStats = stats; this.miningStats = stats;
}); });
} }

View File

@ -28,7 +28,7 @@ export class EtaService {
return combineLatest([ return combineLatest([
this.stateService.mempoolTxPosition$.pipe(map(p => p?.position)), this.stateService.mempoolTxPosition$.pipe(map(p => p?.position)),
this.stateService.difficultyAdjustment$, this.stateService.difficultyAdjustment$,
miningStats ? of(miningStats) : this.miningService.getMiningStats('1w'), miningStats ? of(miningStats) : this.miningService.getMiningStats('1m'),
]).pipe( ]).pipe(
map(([mempoolPosition, da, miningStats]) => { map(([mempoolPosition, da, miningStats]) => {
if (!mempoolPosition || !estimate?.pools?.length || !miningStats || !da) { if (!mempoolPosition || !estimate?.pools?.length || !miningStats || !da) {