1

Hello guys i'm receiving this pretty often, not every time but often enough:

Transaction was not confirmed in 30.00 seconds. It is unknown if it succeeded or failed. Check signature 4P9EvJXP6N9cRimKjPK76oChDR4DDnJByRofCJZs6axFVr9jTPKiq9ryNqq1NvB2NAqL2cxBAzYfp6KnRZw5WQ6Z using the Solana Explorer or CLI tools.

Any idea what might cause it?

This is how i create my connection:

const connection = new Connection(rpcUrl,'confirmed');

for broadcasting tx i'm using:

const hash = await connection.sendTransaction(transaction, [this._signer]);

and after transaction is broadcasted i'm using:

connection.confirmTransaction(hash, 'confirmed');

Any idea what might be the reason for the issue

Andon Mitev
  • 1,354
  • 1
  • 11
  • 30
  • I face that pretty often when uploading big collection of NFTs, and in my experience 9/10 times it's cuz of the network being too busy. I just switch my rpc(usually helps but not that often) and try and even if that won't help I just wait and try after few hours... I wrote a script which sleeps x minutes and tries over until it successfully uploads. made my life a lot easier haha – Bek Jun 15 '22 at 08:55

2 Answers2

1

Time is not a good measurement on whether the transaction was confirmed or not.

In the latest version of @solana/web3.js, confirmTransaction uses blockHeight and how many blocks the transaction is valid for to determine if the transaction was processed.

You will need to retry your transaction if it is not confirmed.

You can find more information at SolanaCookbook.

Jacob Creech
  • 1,797
  • 2
  • 11
0

That's how I do check for blockHeight when using Phantom:

 transaction.feePayer = publicKey;
 transaction.recentBlockhash = (await connection.getLatestBlockhash()).blockhash;
 const latestBlockHash = await connection.getLatestBlockhash()

         
 const { signature } = await provider.signAndSendTransaction(transaction);
         
 const confirmation = await connection.confirmTransaction(
            {
              blockhash: latestBlockHash.blockhash,
              lastValidBlockHeight: latestBlockHash.lastValidBlockHeight,
              signature,
            }
          );
Digital Dom
  • 412
  • 5
  • 12