<p>Due to the decentralized nature of blockchains, the state of transactions is relative.  A pending transaction is one that your node has seen and verified as valid, yet your node has <em>not</em> seen a block that includes it.  This might not be the same state that other nodes see.</p>

<p>For example, one-block chain forks are a common occurrence, where there is a disagreement on the network as to which block is the next valid block.  This will usually resolve itself when a block is found on top of one of these two blocks, but in the meantime, there is disagreement about which transactions have been included in a block.</p>

<p>There is also the possibility that your node has not seen a transaction, whereas other nodes (including mining nodes) have.  You wouldn't have this transaction in your list of pending transactions, even though there are miners actively attempting to include it in a block.  The opposite is also true, where you have seen a transaction, but miners are ignoring it for whatever reason.  Bitcoin is actually pretty good about these scenarios, so it normally isn't an issue, but it is a possibility.</p>

<p>In addition, there is the question of a transaction's validity.  Even though you can be fairly certain that a transaction is valid without independently verifying it with a downloaded copy of the blockchain, you can only be completely sure if you <em>do</em> independently verify it.  If your node is ever wrong or in disagreement with the network about a transaction's validity, then you may consider it pending whereas mining nodes will never include it in a block.  Again, the opposite is also possible.</p>

<p>In order to see which transactions your node (assuming Bitcoin or Bitcoin-based) has "pending", you can use the <code>getrawmempool</code> RPC command.</p>

<p>Further reading:</p>

<p><a href="https://bitcoin.stackexchange.com/questions/35811/bitcoind-getrawmempool-without-downloading-the-full-blockchain">bitcoind getrawmempool without downloading the full blockchain</a></p>

<p><a href="https://bitcoin.stackexchange.com/questions/20720/is-it-possible-to-view-unconfirmed-transactions-with-the-bitcoin-client">Is it possible to view unconfirmed transactions with the bitcoin client?</a></p>

CC BY-SA 3.0
2017-10-11T16:23:14.473Z
2017-10-11T16:23:14.473Z
Jestin
<p>How do I get number of pending transactions (queued and waiting for confirmation) for an arbitrary blockchain? Do I need to download that blockchain? There should be a more adequate way.</p>

<blockchain><unconfirmed-transactions>
How do I get number of pending transactions for an arbitrary blockchain
jayarjo
# How do I get number of pending transactions for an arbitrary blockchain

(Asked by: username_0 on 2017-10-11)

How do I get number of pending transactions (queued and waiting for confirmation) for an arbitrary blockchain? Do I need to download that blockchain? There should be a more adequate way.

**Tags:** blockchain, unconfirmed-transactions


---

## 1 answers

### Answer by username_1 on 2017-10-11. Score: 1

Due to the decentralized nature of blockchains, the state of transactions is relative. A pending transaction is one that your node has seen and verified as valid, yet your node has *not* seen a block that includes it. This might not be the same state that other nodes see.

For example, one-block chain forks are a common occurrence, where there is a disagreement on the network as to which block is the next valid block. This will usually resolve itself when a block is found on top of one of these two blocks, but in the meantime, there is disagreement about which transactions have been included in a block.

There is also the possibility that your node has not seen a transaction, whereas other nodes (including mining nodes) have. You wouldn't have this transaction in your list of pending transactions, even though there are miners actively attempting to include it in a block. The opposite is also true, where you have seen a transaction, but miners are ignoring it for whatever reason. Bitcoin is actually pretty good about these scenarios, so it normally isn't an issue, but it is a possibility.

In addition, there is the question of a transaction's validity. Even though you can be fairly certain that a transaction is valid without independently verifying it with a downloaded copy of the blockchain, you can only be completely sure if you *do* independently verify it. If your node is ever wrong or in disagreement with the network about a transaction's validity, then you may consider it pending whereas mining nodes will never include it in a block. Again, the opposite is also possible.

In order to see which transactions your node (assuming Bitcoin or Bitcoin-based) has "pending", you can use the `getrawmempool` RPC command.

Further reading:

[bitcoind getrawmempool without downloading the full blockchain](https://bitcoin.stackexchange.com/questions/35811/bitcoind-getrawmempool-without-downloading-the-full-blockchain)

[Is it possible to view unconfirmed transactions with the bitcoin client?](https://bitcoin.stackexchange.com/questions/20720/is-it-possible-to-view-unconfirmed-transactions-with-the-bitcoin-client)


---

