Merge pull request #3110 from mempool/nymkappa/bugfix/missing-price-unconfirmed-tx

Fix 'NaN' price for unconfirmed transaction since we have no block timestamp
This commit is contained in:
softsimon 2023-02-22 15:48:05 +04:00 committed by GitHub
commit 6e7ed29caa
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -93,6 +93,10 @@ export class PriceService {
* @param blockTimestamp
*/
getPriceForTimestamp(blockTimestamp: number): Price | null {
if (!blockTimestamp) {
return undefined;
}
const priceTimestamps = Object.keys(this.historicalPrice.prices);
priceTimestamps.push(Number.MAX_SAFE_INTEGER.toString());
priceTimestamps.sort().reverse();