<p>OK, so I found an output field in <code>getwalletinfo</code> called <code>&quot;txcount&quot;</code> in the top level of the output JSON that will list the number of transactions inside the wallet.</p>
<pre><code>{
  ...
  &quot;txcount&quot;: 680899,
  ...
}
</code></pre>

CC BY-SA 4.0
2023-06-25T14:36:48.323Z
2023-06-25T14:36:48.323Z
Zenul_Abidin
<p>I am trying to find a way to get the number of transactions returned from the JSONRPC interface without relying on listtransactions. The reason for this is that if the wallet has too many transactions (like hundreds of thousands), it can easily flood the node's memory and cause a crash. So I would like to know if there is a less intensive way to get just the number of transactions, so I can use listtransactions with the skip= and count= parameters to iterate in reverse order.</p>

<json-rpc><bitcoin-cli>
bitcoin-cli: Get transaction count of wallet without listtransactions
Zenul_Abidin
# bitcoin-cli: Get transaction count of wallet without listtransactions

(Asked by: username_0 on 2023-06-25)

I am trying to find a way to get the number of transactions returned from the JSONRPC interface without relying on listtransactions. The reason for this is that if the wallet has too many transactions (like hundreds of thousands), it can easily flood the node's memory and cause a crash. So I would like to know if there is a less intensive way to get just the number of transactions, so I can use listtransactions with the skip= and count= parameters to iterate in reverse order.

**Tags:** json-rpc, bitcoin-cli


---

## 1 answers

### Answer by username_0 on 2023-06-25. Score: 1

OK, so I found an output field in `getwalletinfo` called `"txcount"` in the top level of the output JSON that will list the number of transactions inside the wallet.

```
{
  ...
  "txcount": 680899,
  ...
}

```


---

