diff options
author | John Newbery <john@johnnewbery.com> | 2021-08-24 11:47:17 +0100 |
---|---|---|
committer | John Newbery <john@johnnewbery.com> | 2021-08-27 11:01:43 +0100 |
commit | 5840476714ffebb2599999c85a23b52ebcff6090 (patch) | |
tree | 9b3daa8e0ade595d00a092984ad09c422f5e0e85 /src/net.cpp | |
parent | f9002cb5dbd573cd9ca200de21319fa296e26055 (diff) | |
download | bitcoin-5840476714ffebb2599999c85a23b52ebcff6090.tar.xz |
[addrman] Make m_asmap private
Add a GetAsmap() getter function that returns a reference to const.
Diffstat (limited to 'src/net.cpp')
-rw-r--r-- | src/net.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/net.cpp b/src/net.cpp index 65544352ee..f4745f1f5d 100644 --- a/src/net.cpp +++ b/src/net.cpp @@ -1936,7 +1936,7 @@ void CConnman::ThreadOpenConnections(const std::vector<std::string> connect) case ConnectionType::BLOCK_RELAY: case ConnectionType::ADDR_FETCH: case ConnectionType::FEELER: - setConnected.insert(pnode->addr.GetGroup(addrman.m_asmap)); + setConnected.insert(pnode->addr.GetGroup(addrman.GetAsmap())); } // no default case, so the compiler can warn about missing cases } } @@ -2010,7 +2010,7 @@ void CConnman::ThreadOpenConnections(const std::vector<std::string> connect) m_anchors.pop_back(); if (!addr.IsValid() || IsLocal(addr) || !IsReachable(addr) || !HasAllDesirableServiceFlags(addr.nServices) || - setConnected.count(addr.GetGroup(addrman.m_asmap))) continue; + setConnected.count(addr.GetGroup(addrman.GetAsmap()))) continue; addrConnect = addr; LogPrint(BCLog::NET, "Trying to make an anchor connection to %s\n", addrConnect.ToString()); break; @@ -2050,7 +2050,7 @@ void CConnman::ThreadOpenConnections(const std::vector<std::string> connect) } // Require outbound connections, other than feelers, to be to distinct network groups - if (!fFeeler && setConnected.count(addr.GetGroup(addrman.m_asmap))) { + if (!fFeeler && setConnected.count(addr.GetGroup(addrman.GetAsmap()))) { break; } @@ -2819,7 +2819,7 @@ void CConnman::GetNodeStats(std::vector<CNodeStats>& vstats) const vstats.reserve(vNodes.size()); for (CNode* pnode : vNodes) { vstats.emplace_back(); - pnode->CopyStats(vstats.back(), addrman.m_asmap); + pnode->CopyStats(vstats.back(), addrman.GetAsmap()); } } @@ -3082,7 +3082,7 @@ CSipHasher CConnman::GetDeterministicRandomizer(uint64_t id) const uint64_t CConnman::CalculateKeyedNetGroup(const CAddress& ad) const { - std::vector<unsigned char> vchNetGroup(ad.GetGroup(addrman.m_asmap)); + std::vector<unsigned char> vchNetGroup(ad.GetGroup(addrman.GetAsmap())); return GetDeterministicRandomizer(RANDOMIZER_ID_NETGROUP).Write(vchNetGroup.data(), vchNetGroup.size()).Finalize(); } |