diff options
author | Dhruv Mehta <856960+dhruv@users.noreply.github.com> | 2020-09-25 12:33:47 -0700 |
---|---|---|
committer | dhruv <856960+dhruv@users.noreply.github.com> | 2022-10-18 09:51:36 -0700 |
commit | 2555a3950f0304b7af7609c1e6c696993c50ac72 (patch) | |
tree | ca9864c9e01c7c27236167183192c11e6128bebe /src | |
parent | 5974c49f90eaece7b8ead7b98975a73e69ce4719 (diff) | |
download | bitcoin-2555a3950f0304b7af7609c1e6c696993c50ac72.tar.xz |
p2p: ProcessAddrFetch(-seednode) is unnecessary if -connect is specified
Diffstat (limited to 'src')
-rw-r--r-- | src/init.cpp | 7 | ||||
-rw-r--r-- | src/net.cpp | 8 |
2 files changed, 12 insertions, 3 deletions
diff --git a/src/init.cpp b/src/init.cpp index 1b3162bf39..d6207f31de 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -1799,6 +1799,13 @@ bool AppInitMain(NodeContext& node, interfaces::BlockAndHeaderTipInfo* tip_info) if (connect.size() != 1 || connect[0] != "0") { connOptions.m_specified_outgoing = connect; } + if (!connOptions.m_specified_outgoing.empty() && !connOptions.vSeedNodes.empty()) { + LogPrintf("-seednode is ignored when -connect is used\n"); + } + + if (args.IsArgSet("-dnsseed") && args.GetBoolArg("-dnsseed", DEFAULT_DNSSEED) && args.IsArgSet("-proxy")) { + LogPrintf("-dnsseed is ignored when -connect is used and -proxy is specified\n"); + } } const std::string& i2psam_arg = args.GetArg("-i2psam", ""); diff --git a/src/net.cpp b/src/net.cpp index 3c28b9eddf..e7ce2e014b 100644 --- a/src/net.cpp +++ b/src/net.cpp @@ -1465,6 +1465,8 @@ void CConnman::ThreadDNSAddressSeed() } LogPrintf("Loading addresses from DNS seed %s\n", seed); + // If -proxy is in use, we make an ADDR_FETCH connection to the DNS resolved peer address + // for the base dns seed domain in chainparams if (HaveNameProxy()) { AddAddrFetch(seed); } else { @@ -1486,8 +1488,9 @@ void CConnman::ThreadDNSAddressSeed() } addrman.Add(vAdd, resolveSource); } else { - // We now avoid directly using results from DNS Seeds which do not support service bit filtering, - // instead using them as a addrfetch to get nodes with our desired service bits. + // If the seed does not support a subdomain with our desired service bits, + // we make an ADDR_FETCH connection to the DNS resolved peer address for the + // base dns seed domain in chainparams AddAddrFetch(seed); } } @@ -1583,7 +1586,6 @@ void CConnman::ThreadOpenConnections(const std::vector<std::string> connect) { for (int64_t nLoop = 0;; nLoop++) { - ProcessAddrFetch(); for (const std::string& strAddr : connect) { CAddress addr(CService(), NODE_NONE); |