aboutsummaryrefslogtreecommitdiff
path: root/src/protocol.cpp
diff options
context:
space:
mode:
authorJonas Schnelli <dev@jonasschnelli.ch>2018-02-17 21:28:50 +1100
committerJonas Schnelli <dev@jonasschnelli.ch>2018-02-17 21:28:50 +1100
commiteb9183535d5fc2dfe8c0e26378f2621d3473c303 (patch)
tree70b48dc82edef8dd5d44424e46143fff8e0581c5 /src/protocol.cpp
parent3f56df5b7564878330ddddddec8afa923a4f8390 (diff)
Add setter for g_initial_block_download_completed
Diffstat (limited to 'src/protocol.cpp')
-rw-r--r--src/protocol.cpp13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/protocol.cpp b/src/protocol.cpp
index ea78ab6856..2ec26fbd3e 100644
--- a/src/protocol.cpp
+++ b/src/protocol.cpp
@@ -12,7 +12,7 @@
# include <arpa/inet.h>
#endif
-std::atomic<bool> g_initial_block_download_completed(false);
+static std::atomic<bool> g_initial_block_download_completed(false);
namespace NetMsgType {
const char *VERSION="version";
@@ -129,6 +129,17 @@ bool CMessageHeader::IsValid(const MessageStartChars& pchMessageStartIn) const
}
+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);
+}
+
+void SetServiceFlagsIBDCache(bool state) {
+ g_initial_block_download_completed = state;
+}
+
CAddress::CAddress() : CService()
{