From c77c877a8e916878e09f64b2faa12eeca7528cc8 Mon Sep 17 00:00:00 2001 From: Martin Zumsande Date: Wed, 30 Nov 2022 15:55:22 -0500 Subject: net: Load fixed seeds from reachable networks for which we don't have addresses Previously, we'd only load fixed seeds if we'd not know any addresses at all. This change makes it possible to change -onlynet abruptly, e.g. from -onlynet=onion to -onlynet=i2p and still find peers. --- src/net.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/net.h') diff --git a/src/net.h b/src/net.h index 31d17ea76c..666e0f3b8a 100644 --- a/src/net.h +++ b/src/net.h @@ -39,6 +39,7 @@ #include #include #include +#include #include class AddrMan; @@ -969,6 +970,12 @@ private: void RecordBytesRecv(uint64_t bytes); void RecordBytesSent(uint64_t bytes) EXCLUSIVE_LOCKS_REQUIRED(!m_total_bytes_sent_mutex); + /** + Return reachable networks for which we have no addresses in addrman and therefore + may require loading fixed seeds. + */ + std::unordered_set GetReachableEmptyNetworks() const; + /** * Return vector of current BLOCK_RELAY peers. */ -- cgit v1.2.3