Quantcast
Channel: solana wallet adapter making ~30 getBlockHeight calls - Solana Stack Exchange
Viewing all articles
Browse latest Browse all 2

solana wallet adapter making ~30 getBlockHeight calls

$
0
0

I'm using the solana wallet adapter for React, as well as a quicknode free rpc, on mainnet.

//send total trasnaction    const {      context: { slot: minContextSlot },      value: { blockhash, lastValidBlockHeight }    } = await connection.getLatestBlockhashAndContext();    const signature = await wallet.sendTransaction(transaction, connection, { minContextSlot });    var sigStatus = await connection.getSignatureStatus(signature);    if(sigStatus.value == null){ //non-null value should mean the transaction was already finalized and doesn't need confirmation      var confirmation = await connection.confirmTransaction({ blockhash, lastValidBlockHeight, signature });    }

Running this code makes about 30 getBlockHeight calls, and takes a while to finish, and is delaying the display of the txhash. Is there anything I can do to improve the speed of this code? Thanks in advance and let me know if you need any more information.


Viewing all articles
Browse latest Browse all 2

Latest Images

Trending Articles



Latest Images