-1

Its quite possible I have a logical error somewhere but I'll ask the question anyway as I am experiencing some very weird errors..

Is it possible for web3.sendAndConfirmTransaction(.. to return a signature but moments later (for that same invocation) to throw an exception even though my program has moved onto the next lines of code..

const createMintSig = await web3.sendAndConfirmTransaction(connection, transaction, [this.appTreasPair, mintAccount], {
      skipPreflight: skipPreflight
    });
1977
  • 2,580
  • 6
  • 26
  • 37

1 Answers1

0

sendAndConfirmTransaction will always send the transaction, and then poll for the confirmation, so it's impossible for it to return and then fail.

You may have other code that executes during the await portion of the send and confirm transaction, which makes it look like it's moved on, or perhaps you're actually triggering it twice.

Here's the source code for it: https://github.com/solana-labs/solana/blob/24122768dada870de046743b89045364ecd7d4d5/web3.js/src/util/send-and-confirm-transaction.ts#L18

Jon C
  • 7,019
  • 10
  • 17