36f814c0e8[netgroupman] Remove NetGroupManager::GetAsmap() (John Newbery)4709fc2019[netgroupman] Move asmap checksum calculation to NetGroupManager (John Newbery)1b978a7e8c[netgroupman] Move GetMappedAS() and GetGroup() logic to NetGroupManager (John Newbery)ddb4101e63[net] Only use public CNetAddr functions and data in GetMappedAS() and GetGroup() (John Newbery)6b2268162e[netgroupman] Add GetMappedAS() and GetGroup() (John Newbery)19431560e3[net] Move asmap into NetGroupManager (John Newbery)17c24d4580[init] Add netgroupman to node.context (John Newbery)9b3836710b[build] Add netgroup.cpp|h (John Newbery) Pull request description: The asmap data is currently owned by addrman, but is used by both addrman and connman. #22791 made the data const and private (so that it can't be updated by other components), but it is still passed out of addrman as a reference to const, and used by `CNetAddress` to calculate the group and AS of the net address. This RFC PR proposes to move all asmap data and logic into a new `NetGroupManager` component. This is initialized at startup, and the client components addrman and connman simply call `NetGroupManager::GetGroup(const CAddress&)` and `NetGroupManager::GetMappedAS(const CAddress&)` to get the net group and AS of an address. ACKs for top commit: mzumsande: Code Review ACK36f814c0e8jnewbery: CI failure seems spurious. I rebased onto latest master to trigger a new CI run, but whilst I was doing that, mzumsande ACKed36f814c0e8, so I've reverted to that. dergoegge: Code review ACK36f814c0e8Tree-SHA512: 244a89cdfd720d8cce679eae5b7951e1b46b37835fccb6bdfa362856761bb110e79e263a6eeee8246140890f3bee2850e9baa7bc14a388a588e0e29b9d275175
src/node/
The src/node/ directory contains code that needs to access node state
(state in CChain, CBlockIndex, CCoinsView, CTxMemPool, and similar
classes).
Code in src/node/ is meant to be segregated from code in
src/wallet/ and src/qt/, to ensure wallet and GUI
code changes don't interfere with node operation, to allow wallet and GUI code
to run in separate processes, and to perhaps eventually allow wallet and GUI
code to be maintained in separate source repositories.
As a rule of thumb, code in one of the src/node/,
src/wallet/, or src/qt/ directories should avoid
calling code in the other directories directly, and only invoke it indirectly
through the more limited src/interfaces/ classes.
This directory is at the moment
sparsely populated. Eventually more substantial files like
src/validation.cpp and
src/txmempool.cpp might be moved there.