0

When I call the .send(); from Web3.js based browser Javascript code, there is a 30 second delay right after I submit payment via the Metamask extension before the call returns with the Tx hash. Note, I am not referring to the time it takes for the block to mine. I'm saying it takes 30 seconds just to get the Tx hash back from the Rinkeby network, letting me know my transaction is pending in the mining pool. In other words:

  • I make the .send(); call
  • Metamask extension pops up
  • I submit my payment
  • 30 seconds passes before the .then() block attached to the .send(); call is triggered.

Is this normal? If not, what could be causing this problem and how could I fix it? I have done hundreds of trials with different smart contract methods, and it's always the same. This doesn't happen when running with Ganache. I know that's a local network, but the fact it's always a 30 second delay with Rinkeby indicates something suspicious. I see the same problem on my server side code when signing and sending transactions on the server side using the Infura API. Does Metamask use the Infura API?

1

If you are using web3 v1.0. From the documentation it generates a 'transactionHash' event that should be called immediately ...send({..}).on('transactionHash', function(transactionHash){ ... }).

The .then() is called when the transaction is mined.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.