To increase modularisation and simplify testing, remove the mempool global from net in favour of a mempool member.
This is done in the same way it was done for the connection manager global.
To increase modularisation and simplify testing, remove the mempool global from net in favour of a mempool member.
This is done in the same way it was done for the connection manager global.
<!--e57a25ab6845829454e8d69fc972939a-->
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.
<!--174a7506f384e20aa4161008e828411d-->
Reviewers, 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.
Concept ACK - my only concern is that this increases the number of cases in which the local and the global form of the variable are shadowing one another. How about doing something like this (in whole or in part) to simplify the call patterns overall while making the member references locally explicit: https://github.com/Empact/bitcoin/tree/2020-01-peer-logic-members
my only concern is that this increases the number of cases in which the local and the global form of the variable are shadowing one another
The global will be renamed to g_mempool, so this won't be an issue. See also #17564 (review)
How about doing something like this (in whole or in part) to simplify the call patterns overall while making the member references locally explicit:
Looks good. But seems to increase the diff and time needed to review, so I'd rather do it as a follow-up.
Concept ACK
Reduced use of globals is very welcome from a fuzzing perspective :)
ACK fa6ff6e7346ca87dfcb9331d1b21b131c91a8f58, I think it makes more sense squashed.
ACK https://github.com/bitcoin/bitcoin/pull/17997/commits/fa6ff6e7346ca87dfcb9331d1b21b131c91a8f58 code review plus I checked each existing mempool reference to ensure there were no remaining references to ::mempool.
Rebased
Code review ACK fa2c363cca8cb2224bc90a47362244af9a9c498e.
This refactor does two things:
* Pass mempool in to PeerLogicValidation
* Pass m_mempool around where needed
code review ACK fa7fea3654203bf7e7bd504589dd564af7fc749d
(looking forward to the mempool -> g_mempool rename)