mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-11 14:38:29 +01:00
Add setter for g_initial_block_download_completed
This commit is contained in:
@@ -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()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user