replace getRecentBlockhash to getLatestBlockhash (#2205)

This commit is contained in:
Deep Mehta 2022-11-14 22:29:36 +05:30 committed by GitHub
parent 43ab991852
commit e8618a588f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 4 deletions

View File

@ -388,7 +388,7 @@ async function signTransactions({
wallet,
connection,
}) {
const blockhash = (await connection.getRecentBlockhash("finalized"))
const blockhash = (await connection.getLatestBlockhash("finalized"))
.blockhash;
transactionsAndSigners.forEach(({ transaction, signers = [] }) => {
transaction.recentBlockhash = blockhash;

View File

@ -459,7 +459,7 @@ async function signTransactions({
wallet,
connection,
}) {
const blockhash = (await connection.getRecentBlockhash("finalized"))
const blockhash = (await connection.getLatestBlockhash("finalized"))
.blockhash;
transactionsAndSigners.forEach(({ transaction, signers = [] }) => {
transaction.recentBlockhash = blockhash;

View File

@ -134,7 +134,7 @@ export class AnchorProvider implements Provider {
tx.feePayer = this.wallet.publicKey;
tx.recentBlockhash = (
await this.connection.getRecentBlockhash(opts.preflightCommitment)
await this.connection.getLatestBlockhash(opts.preflightCommitment)
).blockhash;
tx = await this.wallet.signTransaction(tx);
@ -180,7 +180,7 @@ export class AnchorProvider implements Provider {
if (opts === undefined) {
opts = this.opts;
}
const blockhash = await this.connection.getRecentBlockhash(
const blockhash = await this.connection.getLatestBlockhash(
opts.preflightCommitment
);