Skip to content

Commit ce42570

Browse files
committed
doc: comment "add only reachable addresses to addrman"
1 parent 37095c7 commit ce42570

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/net.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1648,6 +1648,14 @@ void CConnman::ThreadOpenConnections(const std::vector<std::string> connect)
16481648

16491649
if (add_fixed_seeds_now) {
16501650
std::vector<CAddress> seed_addrs{ConvertSeeds(Params().FixedSeeds())};
1651+
// We will not make outgoing connections to peers that are unreachable
1652+
// (e.g. because of -onlynet configuration).
1653+
// Therefore, we do not add them to addrman in the first place.
1654+
// Note that if you change -onlynet setting from one network to another,
1655+
// peers.dat will contain only peers of unreachable networks and
1656+
// manual intervention will be needed (either delete peers.dat after
1657+
// configuration change or manually add some reachable peer using addnode),
1658+
// see <https://github.com/bitcoin/bitcoin/issues/26035> for details.
16511659
seed_addrs.erase(std::remove_if(seed_addrs.begin(), seed_addrs.end(),
16521660
[](const CAddress& addr) { return !IsReachable(addr); }),
16531661
seed_addrs.end());

0 commit comments

Comments
 (0)