1

I tried to generate nonce using this formula, so I can avoid 'underpriced' problem and nonce conflicts

nonce: web3.utils.toHex( Math.round (Date.now() / 1000 - 1586000000)  ),

But simply these transactions are been refused ( I am using Infura rpc)

Why?

Actually it generates number like 365158. Not so great I think...

  • Thanks, but I know how to getTransactionCount for nonce calculation, it was just an idea for cases when sending 2 or more transaction in a minute and so old ones are note mined. Just a curiosity – realtebo Apr 9 at 7:47
1

The nonces must be processed in order (i.e. 0, 1, 2, ...).

Your formula will not achieve this order and your transactions will be ignored.

| improve this answer | |

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