Commit 181a1207 introduced an initialization order bug: CAddrMan’s m_asmap must be set before deserializing peers.dat.
The first commit restores the correct initialization order. The remaining commits make CAddrMan::m_asmap
usage safer:
- don’t reach into
CAddrMan
’s internal data fromCConnMan
- set
m_asmap
in the initializer list and make it const - make
m_asmap
private, and access it (as a reference to const) from a getter.
This ensures that peers.dat deserialization must happen after setting m_asmap, since m_asmap is set during CAddrMan construction.