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.
-
resubmitting transaction will not help anyhow. You will get an error message, that this transaction was already seen– NulikCommented Feb 10, 2021 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 PeltonenCommented Feb 10, 2021 at 17:39
-
Agree, @LauriPeltonen– Suzana Maranhão MorenoCommented Feb 10, 2021 at 18:20
Add a comment
|
1 Answer
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.