mirror of https://github.com/certusone/oyster.git
fix: increase tx timeout to 30s and show timeout msg
This commit is contained in:
parent
137321e7a3
commit
783a7eab0f
|
@ -398,6 +398,26 @@ export const sendTransaction = async (
|
||||||
console.error('getErrorForTransaction() error', ex);
|
console.error('getErrorForTransaction() error', ex);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ('timeout' in confirmationStatus.err) {
|
||||||
|
notify({
|
||||||
|
message: `Transaction hasn't been confirmed within ${
|
||||||
|
DEFAULT_TIMEOUT / 1000
|
||||||
|
}s. Please check on Solana Explorer`,
|
||||||
|
description: (
|
||||||
|
<>
|
||||||
|
<ExplorerLink
|
||||||
|
address={txid}
|
||||||
|
type="transaction"
|
||||||
|
short
|
||||||
|
connection={connection}
|
||||||
|
/>
|
||||||
|
</>
|
||||||
|
),
|
||||||
|
type: 'warn',
|
||||||
|
});
|
||||||
|
throw new TransactionTimeoutError(txid);
|
||||||
|
}
|
||||||
|
|
||||||
notify({
|
notify({
|
||||||
message: 'Transaction error',
|
message: 'Transaction error',
|
||||||
description: (
|
description: (
|
||||||
|
@ -416,10 +436,6 @@ export const sendTransaction = async (
|
||||||
type: 'error',
|
type: 'error',
|
||||||
});
|
});
|
||||||
|
|
||||||
if ('timeout' in confirmationStatus.err) {
|
|
||||||
throw new TransactionTimeoutError(txid);
|
|
||||||
}
|
|
||||||
|
|
||||||
throw new SendTransactionError(
|
throw new SendTransactionError(
|
||||||
`Transaction ${txid} failed (${JSON.stringify(confirmationStatus)})`,
|
`Transaction ${txid} failed (${JSON.stringify(confirmationStatus)})`,
|
||||||
txid,
|
txid,
|
||||||
|
@ -480,7 +496,7 @@ export const getUnixTs = () => {
|
||||||
return new Date().getTime() / 1000;
|
return new Date().getTime() / 1000;
|
||||||
};
|
};
|
||||||
|
|
||||||
const DEFAULT_TIMEOUT = 15000;
|
const DEFAULT_TIMEOUT = 30000;
|
||||||
|
|
||||||
export async function sendSignedTransaction({
|
export async function sendSignedTransaction({
|
||||||
signedTransaction,
|
signedTransaction,
|
||||||
|
|
Loading…
Reference in New Issue