@@ -470,8 +470,8 @@ CNode* CConnman::ConnectNode(CAddress addrConnect, const char *pszDest, bool fCo
470470 Ticks<HoursDouble>(pszDest ? 0h : Now<NodeSeconds>() - addrConnect.nTime ));
471471
472472 // Resolve
473- const uint16_t default_port{pszDest != nullptr ? Params () .GetDefaultPort (pszDest) :
474- Params () .GetDefaultPort ()};
473+ const uint16_t default_port{pszDest != nullptr ? m_params .GetDefaultPort (pszDest) :
474+ m_params .GetDefaultPort ()};
475475 if (pszDest) {
476476 const std::vector<CService> resolved{Lookup (pszDest, default_port, fNameLookup && !HaveNameProxy (), 256 )};
477477 if (!resolved.empty ()) {
@@ -2184,7 +2184,7 @@ void CConnman::WakeMessageHandler()
21842184void CConnman::ThreadDNSAddressSeed ()
21852185{
21862186 FastRandomContext rng;
2187- std::vector<std::string> seeds = Params () .DNSSeeds ();
2187+ std::vector<std::string> seeds = m_params .DNSSeeds ();
21882188 Shuffle (seeds.begin (), seeds.end (), rng);
21892189 int seeds_right_now = 0 ; // Number of seeds left before testing if we have enough connections
21902190 int found = 0 ;
@@ -2275,7 +2275,7 @@ void CConnman::ThreadDNSAddressSeed()
22752275 const auto addresses{LookupHost (host, nMaxIPs, true )};
22762276 if (!addresses.empty ()) {
22772277 for (const CNetAddr& ip : addresses) {
2278- CAddress addr = CAddress (CService (ip, Params () .GetDefaultPort ()), requiredServiceBits);
2278+ CAddress addr = CAddress (CService (ip, m_params .GetDefaultPort ()), requiredServiceBits);
22792279 addr.nTime = rng.rand_uniform_delay (Now<NodeSeconds>() - 3 * 24h, -4 * 24h); // use a random age between 3 and 7 days old
22802280 vAdd.push_back (addr);
22812281 found++;
@@ -2480,7 +2480,7 @@ void CConnman::ThreadOpenConnections(const std::vector<std::string> connect)
24802480 }
24812481
24822482 if (add_fixed_seeds_now) {
2483- std::vector<CAddress> seed_addrs{ConvertSeeds (Params () .FixedSeeds ())};
2483+ std::vector<CAddress> seed_addrs{ConvertSeeds (m_params .FixedSeeds ())};
24842484 // We will not make outgoing connections to peers that are unreachable
24852485 // (e.g. because of -onlynet configuration).
24862486 // Therefore, we do not add them to addrman in the first place.
@@ -2769,7 +2769,7 @@ std::vector<AddedNodeInfo> CConnman::GetAddedNodeInfo() const
27692769 }
27702770
27712771 for (const std::string& strAddNode : lAddresses) {
2772- CService service (LookupNumeric (strAddNode, Params () .GetDefaultPort (strAddNode)));
2772+ CService service (LookupNumeric (strAddNode, m_params .GetDefaultPort (strAddNode)));
27732773 AddedNodeInfo addedNode{strAddNode, CService (), false , false };
27742774 if (service.IsValid ()) {
27752775 // strAddNode is an IP:port
@@ -3075,11 +3075,12 @@ void CConnman::SetNetworkActive(bool active)
30753075}
30763076
30773077CConnman::CConnman (uint64_t nSeed0In, uint64_t nSeed1In, AddrMan& addrman_in,
3078- const NetGroupManager& netgroupman, bool network_active)
3078+ const NetGroupManager& netgroupman, const CChainParams& params, bool network_active)
30793079 : addrman(addrman_in)
30803080 , m_netgroupman{netgroupman}
30813081 , nSeed0(nSeed0In)
30823082 , nSeed1(nSeed1In)
3083+ , m_params(params)
30833084{
30843085 SetTryNewOutboundPeer (false );
30853086
0 commit comments