The transaction count has a flag for getting back pending transactions #3521
Replies: 1 comment
-
You can already do this by either passing Keep in mind you are possibly communicating with a massively load-balanced fleet of nodes, and that pending is only provided on a best-efforts basis. Nodes can have different rules for accepting a tx on the gossip layer, and if it is not accepted then the pending count from that node will not include the tx in its calculations. To do what you are describing, you should use the NonceManager, which fetches the nonce initially and then increments it on each send without making additional calls. Make sense? |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Describe the Feature
I might be wrong, but just went through the documentation, and was wondering if there was an ability for us to get the nonce/transaction count for an address in two separate ways:
Ref: https://docs.ethers.io/v5/api/providers/provider/#Provider-getTransactionCount
Currently, I feel there exists only one of those options, as when we tried to send a few transactions in quick succession, they either replaced the previous transaction due to a higher fee or got rejected due to having a lower fee than the previous transaction.
So the question is, which one of these does ethers support (if not both), and any direction on how I would go about implementing the other one?
Code Example
For Example with web3:
web3.eth.getPendingTransactions().then(console.log);
Beta Was this translation helpful? Give feedback.
All reactions