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?

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.

  • api.blockcypher.com/v1/eth/main/txs returns way too few transactions, I need the total number as an indication of network congestion – praneeth mendu Oct 6 '17 at 11:34
  • Did you try using injectedweb3 with metamask? – Achala Dissanayake Oct 7 '17 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. – Prashant Prabhakar Singh May 26 '18 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 :) – Achala Dissanayake May 29 '18 at 15:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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