explorer: Only report getBlockTime error under max confs (#14869)

This commit is contained in:
Josh 2021-01-26 14:57:50 -08:00 committed by GitHub
parent 7686b70381
commit 9411af4a95
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 10 deletions

View File

@ -75,16 +75,6 @@ export async function fetchTransactionStatus(
let info = null;
if (value !== null) {
let blockTime = null;
try {
blockTime = await connection.getBlockTime(value.slot);
} catch (error) {
if (cluster === Cluster.MainnetBeta) {
reportError(error, { slot: `${value.slot}` });
}
}
let timestamp: Timestamp = blockTime !== null ? blockTime : "unavailable";
let confirmations: Confirmations;
if (typeof value.confirmations === "number") {
confirmations = value.confirmations;
@ -92,6 +82,16 @@ export async function fetchTransactionStatus(
confirmations = "max";
}
let blockTime = null;
try {
blockTime = await connection.getBlockTime(value.slot);
} catch (error) {
if (cluster === Cluster.MainnetBeta && confirmations === "max") {
reportError(error, { slot: `${value.slot}` });
}
}
let timestamp: Timestamp = blockTime !== null ? blockTime : "unavailable";
info = {
slot: value.slot,
timestamp,