-
Notifications
You must be signed in to change notification settings - Fork 38.6k
refactor: Make m_mempool optional in PeerManager #26247
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
The head ref may contain hidden characters: "2210-opt-mem-\u{1F531}"
Conversation
|
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. ReviewsSee the guideline for information on the review process. ConflictsReviewers, this pull request conflicts with the following ones:
If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first. |
|
What's the benefit of a If the goal is to limit memory usage by avoiding having 300MB dedicated to the mempool (which might be filled up during a large reorg, even if you don't accept txs normally), wouldn't it be better to still have the mempool data structure, and at most add an option that guarantees the mempool will remain empty by ignoring attempts to add txs to it; ie a |
Embedded systems where the binary size matters and you would like to run a |
|
Code wise there seems to be a preference to have a pointer than an empty struct, see also #22415 and #25223 . (Updated OP with motivation) Though, I agree that the code doesn't look particularly nice. I was thinking about turning |
fc30b9c to
0122aa7
Compare
|
Wondering if people here would have an opinion on #26471? |
b68ce5d to
6c6ebc5
Compare
- Make m_mempool a pointer in the initialization of PeerManager - Check that m_mempool exists before dereferencing the pointer in PeerManager functions - If m_mempool is a nullptr, turn off transaction relay with all peers by setting m_tx_relay to nullptr
6c6ebc5 to
f413f40
Compare
|
🐙 This pull request conflicts with the target branch and needs rebase. |
Make
m_mempoolan optional pointer in PeerManager, instead of a reference.-nomempooloption. (To run a node with just libbitcoinkernel and a minimal P2P stack to receive blocks)Picked up from #22850