1

I am just interested in the number of pending transactions which I usually get from Etherscan , I have seen references to eth.pendingTransactions online but I cannot find that or an equivalent in the api reference.

Is there any other place I can access that value programmatically?

1 Answer 1

0

From the answer given here, the unconfirmed transaction end point seems like what you want. As explained there,

The returned object is an array of transactions that haven’t been included in blocks, arranged in reverse chronological order (latest is first, then older transactions follow).

unconfirmed means the pending ones.

Or you can connect to the live network itself via web3 and use eth.pendingTrnsactions either by running a full node or using a service like metamask.

As @Prashant suggested in comments, eth.pendingTransactions may be returning pending transaction in mempool of the node you are connected to. And In case your mempool is full, you may miss a tx that is pending =. It may be in pool of others node.

4
  • api.blockcypher.com/v1/eth/main/txs returns way too few transactions, I need the total number as an indication of network congestion Commented Oct 6, 2017 at 11:34
  • Did you try using injectedweb3 with metamask? Commented Oct 7, 2017 at 7:00
  • 1
    As per my understanding, eth.pendingTransactions gives oending transaction in mempool of the node you are connected to. And In case your mempool is full, you may miss a tx that is pending =. It may be in pool of others node. I maybe wrong. Commented May 26, 2018 at 8:26
  • @PrashantPrabhakarSingh That's a good point. I'll edit the answer. if I could confirm it I'll add a reference. Please do edit if you find any source :) Commented May 29, 2018 at 15:16

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.