Skip to content

Commit ef5bb74

Browse files
author
MacroFake
committed
Merge bitcoin/bitcoin#26040: doc: comment "add only reachable addresses to addrman"
ce42570 doc: comment "add only reachable addresses to addrman" (Kristaps Kaupe) Pull request description: Proposed by Sjors during review of #25678, was likely just missed, as it also for me looks a code where comment will not hurt. bitcoin/bitcoin#25678 (comment) ACKs for top commit: mzumsande: ACK ce42570 vasild: ACK ce42570 Zero-1729: re-ACK ce42570 Tree-SHA512: ef085d527349de07c1b43ed39e55e34b29cb0137c9509bd14a1af88206f7d4aa7dfec1dca53a9deaed67a2d0f32fa21e0b1a04d4d5d7f8a265dfab3b62bf8c54
2 parents 3c5fb96 + ce42570 commit ef5bb74

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)