multiple sendTransactions in short time: same nonce -> replacement transaction underpriced #223
Labels
bug
Something isn't working
dependencies
Refers to an update of a dependency file
wontfix
This will not be worked on
Hi,
when I send a few transactions in a short time, only the first one goes through. In the debug log I see the following error message:
To give you a reproducable example I created an minimal example repository where I add two services (one right after the other). The first one works but the second one will fail:
Based on the debug error message I came to the conclusion that both transactions use the same nonce and thus the second one is rejected.
The cause seems to be in ethjs-provider-signer where the transaction count is retrieved and used as nonce. Somehow the previous transaction didn't increment the count yet (maybe because it's not yet in a block?) so the same nonce will be used again.
Possible fixes (?):
addService()
after transaction is validatedIf I understand everything correctly I think this might be a bug of how transactionCount works and should be fixed there? Can anyone confirm this? Then it would not be a bug in this repo but somewhere else. In parallel I will investigate this further to find the root cause.
Maybe something similar: When I run
getDidDocument()
right after adding a service, the service is not yet there (probably transaction is sent but not yet validated in a block).The text was updated successfully, but these errors were encountered: