Inside Bitcoin
Opening the selected file…
Inside Bitcoin
Opening the selected file…
The code behind the network, with room to understand it.
Release published 2026-10-28 · Snapshot fetched 2026-11-01. Latest stable release at fetch time; development branches and Git history are excluded. Only the selected code window and visible folders load here.
1251return entry;1252}1254AddrMan::AddrMan(const NetGroupManager& netgroupman, bool deterministic, int32_t consistency_check_ratio)1255: m_impl(std::make_unique<AddrManImpl>(netgroupman, deterministic, consistency_check_ratio)) {}1257AddrMan::~AddrMan() = default;1259template <typename Stream>1260void AddrMan::Serialize(Stream& s_) const1261{1262m_impl->Serialize<Stream>(s_);1263}1265template <typename Stream>1266void AddrMan::Unserialize(Stream& s_)1267{1268m_impl->Unserialize<Stream>(s_);1269}1271// explicit instantiation1272template void AddrMan::Serialize(HashedSourceWriter<AutoFile>&) const;1273template void AddrMan::Serialize(DataStream&) const;1274template void AddrMan::Unserialize(AutoFile&);1275template void AddrMan::Unserialize(HashVerifier<AutoFile>&);1276template void AddrMan::Unserialize(DataStream&);1277template void AddrMan::Unserialize(HashVerifier<DataStream>&);1279size_t AddrMan::Size(std::optional<Network> net, std::optional<bool> in_new) const1280{1281return m_impl->Size(net, in_new);1282}1284bool AddrMan::Add(const std::vector<CAddress>& vAddr, const CNetAddr& source, std::chrono::seconds time_penalty)1285{1286return m_impl->Add(vAddr, source, time_penalty);1287}1289bool AddrMan::Good(const CService& addr, NodeSeconds time)1290{1291return m_impl->Good(addr, time);1292}1294void AddrMan::Attempt(const CService& addr, bool fCountFailure, NodeSeconds time)1295{1296m_impl->Attempt(addr, fCountFailure, time);1297}1299void AddrMan::ResolveCollisions()1300{1301m_impl->ResolveCollisions();1302}1304std::pair<CAddress, NodeSeconds> AddrMan::SelectTriedCollision()1305{1306return m_impl->SelectTriedCollision();1307}1309std::pair<CAddress, NodeSeconds> AddrMan::Select(bool new_only, const std::unordered_set<Network>& networks) const1310{1311return m_impl->Select(new_only, networks);1312}1314std::vector<CAddress> AddrMan::GetAddr(size_t max_addresses, size_t max_pct, std::optional<Network> network, const bool filtered) const1315{1316return m_impl->GetAddr(max_addresses, max_pct, network, filtered);1317}1319std::vector<std::pair<AddrInfo, AddressPosition>> AddrMan::GetEntries(bool use_tried) const1320{1321return m_impl->GetEntries(use_tried);1322}1324void AddrMan::Connected(const CService& addr, NodeSeconds time)1325{1326m_impl->Connected(addr, time);1327}1329void AddrMan::SetServices(const CService& addr, ServiceFlags nServices)1330{1331m_impl->SetServices(addr, nServices);1332}1334std::optional<AddressPosition> AddrMan::FindAddressEntry(const CAddress& addr)1335{1336return m_impl->FindAddressEntry(addr);1337}