Skip to content

Commit 569fc49

Browse files
committed
use higher commitment for blockhash
1 parent 4000d06 commit 569fc49

File tree

1 file changed

+3
-14
lines changed

1 file changed

+3
-14
lines changed

target_chains/solana/sdk/js/solana_utils/src/transaction.ts

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ export class TransactionBuilder {
227227
args: PriorityFeeConfig
228228
): Promise<{ tx: VersionedTransaction; signers: Signer[] }[]> {
229229
const blockhash = (
230-
await this.connection.getLatestBlockhash({ commitment: "confirmed" })
230+
await this.connection.getLatestBlockhash({ commitment: "finalized" })
231231
).blockhash;
232232

233233
const jitoBundleSize =
@@ -423,7 +423,7 @@ export async function sendTransactions(
423423
maxRetries?: number
424424
): Promise<string[]> {
425425
const blockhashResult = await connection.getLatestBlockhashAndContext({
426-
commitment: "finalized",
426+
commitment: "confirmed",
427427
});
428428

429429
const signatures: string[] = [];
@@ -487,18 +487,7 @@ export async function sendTransactions(
487487
),
488488
]);
489489
if (confirmedTx) {
490-
console.log("this is the err", confirmedTx.err?.toString());
491-
if (
492-
confirmedTx.err &&
493-
confirmedTx.err
494-
.toString()
495-
.includes("Minimum context slot has not been reached.")
496-
) {
497-
console.log("Handling minimum context slot error");
498-
confirmedTx = null;
499-
} else {
500-
break;
501-
}
490+
break;
502491
}
503492
if (maxRetries && maxRetries < retryCount) {
504493
break;

0 commit comments

Comments
 (0)