1

I am making two calls simultaneous call with a single wallet. First I am making a contract call then I am making a ether transaction call. The first call succeeds, but the next call fails. I got this below error

Error: replacement fee too low

Is there any way I can succeed both call?

Also how to manage transactions if more than 10 users make simultaneous transactions on a single wallet?

Thanks

1 Answer 1

2

You have to increment the nonce by one for the second transaction.

Your error is saying that you tried to send two transactions with the same nonce, and the second one didn't have enough gas included. When you send two transactions with the same nonce, the network tries to "replace" the first transaction with the second one, because it assumes that is what you are trying to do. If you do not send >10% of the gasPrice of the first transaction, you will get that error.

You can scale this to n users by incrementing the nonce for each submitted transaction. All other parameters can be the exact same, if desired.

2
  • I have increased the nonce it works fine . I have setuped private blockchain with clique in local with 5 sec avg block time. In server avg block time is 10 sec. I testing my code in local every thing work fine . but in server transaction fails . when i check transaction hash , i found blocknumber:null.
    – Ajit Soman
    Feb 24, 2019 at 16:10
  • i used eth.getTransactionCount('pending') to get nonce. once a make contract call and instantly execute transactioncount method and pass nonce+1 to next transaction . this works in local . but in server it does not work
    – Ajit Soman
    Feb 24, 2019 at 16:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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