A common concern for dapps using public blockchains is to check that a submitted transaction was included in a block after some time. And, if not, try to resubmit the same transaction (I mean, using the same nonce, perhaps with a higher gas price). Does anyone have recommendations/existing code to solve this issue? Ideally in Angular or React.
Asked
Active
Viewed 112 times
0
-
resubmitting transaction will not help anyhow. You will get an error message, that this transaction was already seen – Nulik Feb 10 '21 at 17:35
-
2If you reuse the nonce and use higher gas price, the old transaction will essentially be replaced. This shouldn't cause any errors – Lauri Peltonen Feb 10 '21 at 17:39
-
Agree, @LauriPeltonen – Suzana Maranhão Moreno Feb 10 '21 at 18:20
1 Answers
1
Have a look at candidate 3 over here. Concurrency patterns for account nonce
This is a pretty important issue for any account that sends a lot of transactions since one underpriced transaction blocks all transactions that follow it.
In any such case, monitor confirmation and have a plan to resolve any stuck transactions.
Hope it helps.
Rob Hitchens
- 55,151
- 11
- 89
- 145