aboutsummaryrefslogtreecommitdiff
path: root/src/protocol.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/protocol.h')
-rw-r--r--src/protocol.h5
1 files changed, 5 insertions, 0 deletions
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 <uint256.h>
#include <version.h>
+#include <atomic>
#include <stdint.h>
#include <string>
@@ -277,6 +278,7 @@ enum ServiceFlags : uint64_t {
// BIP process.
};
+extern std::atomic<bool> 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);
}