1

I want my dApp to automatically rebroadcast a transaction if after 50 blocks it is still unmined. How can I do this in javascript with web3 1, having all infos about the pending one? (txHash, ecc)

Maxim Gaina
  • 151
  • 2
  • 9

2 Answers2

0

I found that it can be done by performing web3.eth.sendTransaction again and using the same nonce parameter.

docs

Maxim Gaina
  • 151
  • 2
  • 9
  • 1
    As @Sovan mentioned in his answer it is better to increase your tx fee by 10% by changing your gas parameter in your transaction object. If you are willing to do it in loop, be sure to set the limit so the fee will not accidentially become too high. And also if your answer answers your question accept it by clicking check mark below down vote of your answer. – Roman Frolov Jan 13 '18 at 14:49
0

You can repeat the transaction, sending transaction with the same nonce. Note that you'd better place a bigger fee on it (10%+). You can also try changing the transaction's original nonce, e.g., incrementing nonce value by one. You can find some additional info here.

Garen Vartanian
  • 483
  • 3
  • 14
Sovan
  • 123
  • 2
  • 8