Does the mempool size equal roughly the unconfirmed transactions?

3

1

My bitcoind (v0.13.0) mempool size is currently 12k transactions as can be seen from:

tail -f ~/.bitcoin/debug.log

I find this number very surprising as I naively expected it to keep in line with the number of 'Unmatched transaction' as reported say by blockchain.info which currently shows 3k transactions.

https://blockchain.info/unconfirmed-transactions

What am I missing?

Sven Williamson

Posted 2016-08-24T21:38:17.573

Reputation: 1 314

How long has your code been running? It usually takes hours to days before the mempool fills us that much.Pieter Wuille 2016-08-25T15:35:45.407

It has been running for 10 hours now today. Showing poolsz = 12k and 157MB.Sven Williamson 2016-08-25T15:39:06.983

2Oh, sorry. I thought that your mempool was 12 kB in size. Since Bitcoin Core 0.12, the mempool is really designed to be always at its maximum size. You can check the memory usage with the getmempoolinfo RPC command.Pieter Wuille 2016-08-25T15:48:35.810

what's the difference between "bytes" and "usage" ? "bytes" only showing 85MB with usage 160MB. Please ignore bitcoin-cli getmempoolinfo help got it :) Thanks v much !Sven Williamson 2016-08-25T16:24:54.647

1The sum of the 'size' of transactions is 85 MB (size on the wire), but in memory they consume 160 MB of RAM (due to indexes, allocation overhead, metadata, ...).Pieter Wuille 2016-08-25T17:11:45.173

By default, that 160 will grow to 300.Pieter Wuille 2016-08-25T18:02:33.237

217MB now :) By the way I used to find it very entertaining to watch the mempool log scrolling down with each new accepted transaction and the "subver" field of my connected peers (which I can still get from getpeerinfo). This feature disappeared 2 or 3 upgrades ago. Is there a setting which allows me to have it back?Sven Williamson 2016-08-25T18:50:18.733

Answers

4

Every node owner can set their own policy for the mempool. The mempool is limited two-fold:

  • With -maxmempool=<n> you can set an explicit limit of MB that it will not exceed. The default is 300MB.
  • Transactions that don't surpass the minRelayTxFee are not added to your mempool.

As statoshi.info has the mempool at 145MiB and ~11k transactions, it appears likely that different settings on the minRelayTxFee seem to cause your and blockchain.info's divergent mempool size here.

Murch

Posted 2016-08-24T21:38:17.573

Reputation: 41 609

This is great thank you ! I have minrelaytxfee=0.0002, I am assuming config file is not case sensitive.Sven Williamson 2016-08-24T22:43:12.577

1@SvenWilliamson: Yeah, that's fine. The option is -minrelaytxfee while in the source code it is the camel-case minRelayTxFee.Murch 2016-08-25T06:23:04.050

2Note that since 0.12, the effective relay fee is dynamic, and automatocally increases when the mempool fills up.Pieter Wuille 2016-08-25T07:25:15.860

1@PieterWuille: I was wondering about that: The Developer Guide says "it effectively increases the minRelayTxFee", which I understand to say that some transactions that exceed minRelayTxFee are still not included in the mempool. Does the minRelayTxFee actually increase or does just the lowest included fee rise? The difference would be that the former would also raise derived values such as the dust limit, while the latter wouldn't. Do you happen to know?Murch 2016-08-25T07:28:02.723

3The dust limit and minimum fee increase for replacement (both depend on minRelayTxFee) are not increased when the mempool min fee goes up. The developer guide is wrong to say that minRelayTxFee is increased.Pieter Wuille 2016-08-25T07:38:42.490

okay, thank you.Murch 2016-08-25T07:39:53.190