mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-11 06:28:31 +01:00
Connect to peers signaling NODE_NETWORK_LIMITED when out-of-IBD
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user