mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-18 13:17:55 +02:00
Add setter for g_initial_block_download_completed
This commit is contained in:
parent
3f56df5b75
commit
eb9183535d
3 changed files with 17 additions and 9 deletions
|
|
@ -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()
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue