-
Notifications
You must be signed in to change notification settings - Fork 37.7k
Stop trimming when mapTx is empty #8220
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@sipa ie sizelimit < overhead of zero transactions ? |
@pstratem Yes, given that there are various support data structures in the mempool whose size is hard to scale linearly with the number of transactions, this seems like a reasonable solution. There are certainly others (like requiring the trim size to be at least a multiple of a transaction + overhead), but this is so simple and probably something that should have been there as a safeguard from the start. |
utACK. |
utACK ad0752e |
utACK ad0752e |
ACK ad0752e |
utACK ad0752e |
ACK ad0752e (upgrade from prior utack) |
ad0752e Stop trimming when mapTx is empty (Pieter Wuille)
ad0752e Stop trimming when mapTx is empty (Pieter Wuille)
ad0752e Stop trimming when mapTx is empty (Pieter Wuille)
When CTxMemPool::TrimToSize is called with a very low number (like somewhere in mempool_tests), it is possible that the memory usage never sinks below the specified number.
This is unlikely to be a problem right now, but will be with the introduction of CTxMemPool::vTxHashes in #8068.