Display transaction even if getBlockTime returns an error

This commit is contained in:
Michael Vines 2020-08-08 20:25:44 -07:00 committed by mergify[bot]
parent 88d8d3d02a
commit 4d918f83ff
1 changed files with 11 additions and 1 deletions

View File

@ -232,7 +232,17 @@ export async function fetchTransactionStatus(
});
if (value !== null) {
let blockTime = await connection.getBlockTime(value.slot);
let blockTime = null;
try {
blockTime = await connection.getBlockTime(value.slot);
} catch (error) {
console.error(
"Failed to fetch block time for slot ",
value.slot,
":",
error
);
}
let timestamp: Timestamp =
blockTime !== null ? blockTime : "unavailable";