HomePhabricator

net: ignore block-relay-only peers when skipping DNS seed

Description

net: ignore block-relay-only peers when skipping DNS seed

Summary:
PR description:

Since core#17428 bitcoind will attempt to reconnect to two block-relay-only anchors before doing any other outbound connections. When determining whether to use DNS seeds, it will currently see these two peers and decide "we're connected to the p2p network, so no need to lookup DNS" -- but block-relay-only peers don't do address relay, so if your address book is full of invalid addresses (apart from your anchors) this behaviour will prevent you from recovering from that situation.

This patch changes it so that it only skips use of DNS seeds when there are two full-outbound peers, not just block-relay-only peers.

core#17428 was backported in D10507 -- D10513

This is a backport of core#22013

Test Plan: ninja all check-all

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

Differential Revision: https://reviews.bitcoinabc.org/D12527

Details

Provenance
Anthony Towns <aj@erisian.com.au>Authored on May 21 2021, 03:03
PiRKCommitted on Nov 18 2022, 15:32
PiRKPushed on Nov 18 2022, 15:32
Reviewer
Restricted Project
Differential Revision
D12527: net: ignore block-relay-only peers when skipping DNS seed
Parents
rABCbdb99f9e660a: test: Replace MiniWallet scan_blocks with rescan_utxos
Branches
Unknown
Tags
Unknown