Bitcoin – getrawmempool Behavior
When calling the getrawmempool
RPC method, the number of transactions returned may vary significantly between requests. This is normal and reflects how nodes maintain mempool state.
What You May See
Typical responses may contain anywhere from hundreds to a few thousand transactions, but at times responses may include tens of thousands.
Example RPC request:
curl --location 'https://bitcoin-mainnet.blockchain.tatum.io' \
--header 'Content-Type: application/json' \
--header 'x-api-key: {YOUR_API_KEY}' \
--data '{
"id":1,
"jsonrpc":"2.0",
"method":"getrawmempool",
"params": [false]
}'
//Response_a:
{
"result": [ ... 3,142 transaction hashes ... ],
"id": "1",
"jsonrpc": "2.0"
}
//Response_b:
{
"result": [ ... 37,856 transaction hashes ... ],
"id": "1",
"jsonrpc": "2.0"
}
Note
Both responses are valid. They reflect which node served the request and the state of its mempool at that moment.
Why The Response Difference
Several factors influence the size and content of mempool data:
- Node Uptime
Nodes that have been running longer tend to accumulate more transactions, including low-fee or long-pending ones. Shorter-lived or newly deployed nodes may show fewer. - Mempool Size Configuration
Tatum Bitcoin nodes are configured with amaxmempool
of 4 GB. Transactions are only evicted once this limit is reached.
⚠️ The mempool is not automatically flushed on node restart, it persists unless explicitly evicted by hitting the size limit. - Round-Robin Routing
Tatum routes requests across multiple nodes. Depending on which node responds, the transaction count may vary. - Bitcoin’s UTXO Model
In a UTXO-based chain, like Bitcoin, mempool contents naturally differ between nodes due to transaction propagation, fee policies, and local conditions.
Good To Know
Variations in getrawmempool
results are a natural part of interacting with nodes from UTXO chains, like Bitcoin, in a distributed environment.
- The mempool is not uniform across the network
- Differences in node uptime, configuration, and routing will always create variations.
- Mempool Eviction only occurs in Tatum nodes once
maxmempool
is reached.
Updated 19 days ago