replace getRecentBlockhash to getLatestBlockhash (#2205)
This commit is contained in:
parent
43ab991852
commit
e8618a588f
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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
|
||||
);
|
||||
|
||||
|
|
Loading…
Reference in New Issue