Problem
Hello. I got a problem only on mainnet-beta
. Everything is working fine on devnet
.
Right after my connection.sendTransaction
, I'm doing a connection.confirmTransaction
this way:
const latestBlockHash = await connection.getLatestBlockhash();
await connection.confirmTransaction(
{
blockhash: latestBlockHash.blockhash,
lastValidBlockHeight: latestBlockHash.lastValidBlockHeight,
signature,
},
commitment,
);
But my confirmTransaction
is taking forever (at least a minute), throwing this error infinitely every 1 sec: ws error: received bad response code from server 401
, until this next one is thrown:
ERROR: confirmTransaction > [TransactionExpiredBlockheightExceededError: Signature xxxxxxxxxx has expired: block height exceeded.]
and then it finally works! (except that I still have the error ws error: received bad response code from server 401
popping in my terminal, even though my transaction worked)
I'm not sure why it's throwing this error and why it's taking that long!
In devnet
, everything works in 3-4 sec without any error.
I'm using the lib in React-Native, I'm not sure it's relevant, but it's worth mentioning :)
Thank you in advance for your help.