Skip to content

Commit

Permalink
Revert "sdk: add option to skip confirmation for FastTxSender"
Browse files Browse the repository at this point in the history
This reverts commit 90ca20c.
  • Loading branch information
crispheaney committed Dec 27, 2023
1 parent 46d830a commit a33724b
Showing 1 changed file with 6 additions and 12 deletions.
18 changes: 6 additions & 12 deletions sdk/src/tx/fastSingleTxSender.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ export class FastSingleTxSender extends BaseTxSender {
additionalConnections: Connection[];
timoutCount = 0;
blockhashQueue: string[] = [];
skipConfirmation: boolean;

public constructor({
connection,
Expand All @@ -36,15 +35,13 @@ export class FastSingleTxSender extends BaseTxSender {
timeout = DEFAULT_TIMEOUT,
blockhashRefreshInterval = DEFAULT_BLOCKHASH_REFRESH,
additionalConnections = new Array<Connection>(),
skipConfirmation = true,
}: {
connection: Connection;
wallet: IWallet;
opts?: ConfirmOptions;
timeout?: number;
blockhashRefreshInterval?: number;
additionalConnections?;
skipConfirmation?: boolean;
}) {
super({ connection, wallet, opts, timeout, additionalConnections });
this.connection = connection;
Expand All @@ -53,7 +50,6 @@ export class FastSingleTxSender extends BaseTxSender {
this.timeout = timeout;
this.blockhashRefreshInterval = blockhashRefreshInterval;
this.additionalConnections = additionalConnections;
this.skipConfirmation = skipConfirmation;
this.startBlockhashRefreshLoop();
}

Expand Down Expand Up @@ -148,14 +144,12 @@ export class FastSingleTxSender extends BaseTxSender {
this.sendToAdditionalConnections(rawTransaction, opts);

let slot: number;
if (!this.skipConfirmation) {
try {
const result = await this.confirmTransaction(txid, opts.commitment);
slot = result.context.slot;
} catch (e) {
console.error(e);
throw e;
}
try {
const result = await this.confirmTransaction(txid, opts.commitment);
slot = result.context.slot;
} catch (e) {
console.error(e);
throw e;
}

return { txSig: txid, slot };
Expand Down

0 comments on commit a33724b

Please sign in to comment.