From 6fe57bdaac17d49af9ec7f36c1414d5d2bcec564 Mon Sep 17 00:00:00 2001 From: Jonas Schnelli Date: Fri, 13 Oct 2017 21:48:00 -0700 Subject: Connect to peers signaling NODE_NETWORK_LIMITED when out-of-IBD --- src/protocol.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/protocol.h') diff --git a/src/protocol.h b/src/protocol.h index ec5f55e4f6..4907c38e5c 100644 --- a/src/protocol.h +++ b/src/protocol.h @@ -15,6 +15,7 @@ #include #include +#include #include #include @@ -277,6 +278,7 @@ enum ServiceFlags : uint64_t { // BIP process. }; +extern std::atomic g_initial_block_download_completed; /** * Gets the set of service flags which are "desirable" for a given peer. * @@ -302,6 +304,9 @@ enum ServiceFlags : uint64_t { * should be updated appropriately to filter for the same nodes. */ static ServiceFlags GetDesirableServiceFlags(ServiceFlags services) { + if ((services & NODE_NETWORK_LIMITED) && g_initial_block_download_completed) { + return ServiceFlags(NODE_NETWORK_LIMITED | NODE_WITNESS); + } return ServiceFlags(NODE_NETWORK | NODE_WITNESS); } -- cgit v1.2.3