Skip to content

Commit ac625b5

Browse files
committed
no need for blockhash before signer
1 parent 2e481c2 commit ac625b5

File tree

1 file changed

+5
-13
lines changed

1 file changed

+5
-13
lines changed

solana/ts/src/protocol/matchingEngine.ts

+5-13
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@ export class SolanaMatchingEngine<N extends Network, C extends SolanaChains>
303303

304304
const computeIx = ComputeBudgetProgram.setComputeUnitLimit({ units: 300_000 });
305305

306-
const transaction = await this.createTx(payer, [ix, computeIx], undefined, lookupTables);
306+
const transaction = await this.createTx(payer, [ix, computeIx], lookupTables);
307307
yield this.createUnsignedTx({ transaction }, "MatchingEngine.prepareOrderResponse");
308308
}
309309

@@ -356,12 +356,8 @@ export class SolanaMatchingEngine<N extends Network, C extends SolanaChains>
356356
auction,
357357
});
358358
} else {
359-
return this.settleAuctionNoneCctpIx(
360-
{
361-
payer,
362-
fastVaa,
363-
preparedOrderResponse,
364-
},
359+
return await this.settleAuctionNoneCctpIx(
360+
{ payer, fastVaa, preparedOrderResponse },
365361
{ targetChain: toChainId(fast.payload.targetChain) },
366362
);
367363
}
@@ -376,23 +372,19 @@ export class SolanaMatchingEngine<N extends Network, C extends SolanaChains>
376372

377373
ixs.push(settleIx);
378374

379-
const transaction = await this.createTx(payer, ixs, undefined, lookupTables);
375+
const transaction = await this.createTx(payer, ixs, lookupTables);
380376

381377
yield this.createUnsignedTx({ transaction }, "MatchingEngine.settleAuctionComplete");
382378
}
383379

384380
private async createTx(
385381
payerKey: PublicKey,
386382
instructions: TransactionInstruction[],
387-
recentBlockhash?: string,
388383
lookupTables?: AddressLookupTableAccount[],
389384
): Promise<VersionedTransaction> {
390-
if (!recentBlockhash)
391-
({ blockhash: recentBlockhash } = await this._connection.getLatestBlockhash());
392-
393385
const messageV0 = new TransactionMessage({
394386
payerKey,
395-
recentBlockhash,
387+
recentBlockhash: "",
396388
instructions,
397389
}).compileToV0Message(lookupTables);
398390
return new VersionedTransaction(messageV0);

0 commit comments

Comments
 (0)