I am running loads of transactions in a private POA network, even a few per seconds. The nonces are being managed by a specific service. The issue I encountered was that one sealer somehow didn't manage to mine a transaction (it wasn't reverted) and the next 40-50 transactions were staying in pending tx pool, due to the nonce gap. My question is what would web3.eth.getTransactionCount(sender_address, 'pending') return in this case? The nonce of the unprocessed transaction or NUMBER_OF_MINED_TX_FOR_SENDER + PENDING_TX_COUNT_FOR_SENDER? Or something else?

Thanks in advance


1 Answer 1


If there is a nonce gap, the call will not take those transactions into consideration.

This means, that a call to:

web3.eth.getTransactionCount(sender_address, 'pending')

Will return NUMBER_OF_MINED_TX_FOR_SENDER + PENDING_TX_COUNT_FOR_SENDER only for the transactions that have sequential nonces, without any gap.

But it will take into consideration the not mined transactions that have sequential, non-gapped nonce.

  • Thank you for confirming this.
    – 3DLures
    Feb 19, 2021 at 8:15

Your Answer

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

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