mirror of
https://github.com/mempool/mempool.git
synced 2025-02-24 06:47:52 +01:00
Merge pull request #3119 from mempool/nymkappa/bugfix/historical-price-bitcoin-only
Only query historical price if we're running mempool BASE_MODULE
This commit is contained in:
commit
7d3c7c3f45
1 changed files with 7 additions and 1 deletions
|
@ -1,6 +1,7 @@
|
|||
import { Injectable } from '@angular/core';
|
||||
import { map, Observable, of, share, shareReplay, tap } from 'rxjs';
|
||||
import { ApiService } from './api.service';
|
||||
import { StateService } from './state.service';
|
||||
|
||||
// nodejs backend interfaces
|
||||
export interface ApiPrice {
|
||||
|
@ -52,7 +53,8 @@ export class PriceService {
|
|||
};
|
||||
|
||||
constructor(
|
||||
private apiService: ApiService
|
||||
private apiService: ApiService,
|
||||
private stateService: StateService
|
||||
) {
|
||||
}
|
||||
|
||||
|
@ -68,6 +70,10 @@ export class PriceService {
|
|||
}
|
||||
|
||||
getBlockPrice$(blockTimestamp: number, singlePrice = false): Observable<Price | undefined> {
|
||||
if (this.stateService.env.BASE_MODULE !== 'mempool') {
|
||||
return of(undefined);
|
||||
}
|
||||
|
||||
const now = new Date().getTime() / 1000;
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Reference in a new issue