Only query historical price if we're running mempool BASE_MODULE
This commit is contained in:
parent
da3446f522
commit
b4d0e20d75
@ -1,6 +1,7 @@
|
|||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
import { map, Observable, of, share, shareReplay, tap } from 'rxjs';
|
import { map, Observable, of, share, shareReplay, tap } from 'rxjs';
|
||||||
import { ApiService } from './api.service';
|
import { ApiService } from './api.service';
|
||||||
|
import { StateService } from './state.service';
|
||||||
|
|
||||||
// nodejs backend interfaces
|
// nodejs backend interfaces
|
||||||
export interface ApiPrice {
|
export interface ApiPrice {
|
||||||
@ -52,7 +53,8 @@ export class PriceService {
|
|||||||
};
|
};
|
||||||
|
|
||||||
constructor(
|
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> {
|
getBlockPrice$(blockTimestamp: number, singlePrice = false): Observable<Price | undefined> {
|
||||||
|
if (this.stateService.env.BASE_MODULE !== 'mempool') {
|
||||||
|
return of(undefined);
|
||||||
|
}
|
||||||
|
|
||||||
const now = new Date().getTime() / 1000;
|
const now = new Date().getTime() / 1000;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user