Skip to content

Commit 7caba38

Browse files
committed
Add NODE_NETWORK_LIMITED flags and min block amount constants
1 parent 91eeaa0 commit 7caba38

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

src/protocol.h

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -246,9 +246,8 @@ const std::vector<std::string> &getAllNetMessageTypes();
246246
enum ServiceFlags : uint64_t {
247247
// Nothing
248248
NODE_NONE = 0,
249-
// NODE_NETWORK means that the node is capable of serving the block chain. It is currently
250-
// set by all Bitcoin Core nodes, and is unset by SPV clients or other peers that just want
251-
// network services but don't provide them.
249+
// NODE_NETWORK means that the node is capable of serving the complete block chain. It is currently
250+
// set by all Bitcoin Core non pruned nodes, and is unset by SPV clients or other light clients.
252251
NODE_NETWORK = (1 << 0),
253252
// NODE_GETUTXO means the node is capable of responding to the getutxo protocol request.
254253
// Bitcoin Core does not support this but a patch set called Bitcoin XT does.
@@ -264,6 +263,10 @@ enum ServiceFlags : uint64_t {
264263
// NODE_XTHIN means the node supports Xtreme Thinblocks
265264
// If this is turned off then the node will not service nor make xthin requests
266265
NODE_XTHIN = (1 << 4),
266+
// NODE_NETWORK_LIMITED means the same as NODE_NETWORK with the limitation of only
267+
// serving the last 288 (2 day) blocks
268+
// See BIP159 for details on how this is implemented.
269+
NODE_NETWORK_LIMITED = (1 << 10),
267270

268271
// Bits 24-31 are reserved for temporary experiments. Just pick a bit that
269272
// isn't getting used, or one not being used much, and notify the

src/validation.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,8 @@ extern bool fPruneMode;
203203
extern uint64_t nPruneTarget;
204204
/** Block files containing a block-height within MIN_BLOCKS_TO_KEEP of chainActive.Tip() will not be pruned. */
205205
static const unsigned int MIN_BLOCKS_TO_KEEP = 288;
206+
/** Minimum blocks required to signal NODE_NETWORK_LIMITED */
207+
static const unsigned int NODE_NETWORK_LIMITED_MIN_BLOCKS = 288;
206208

207209
static const signed int DEFAULT_CHECKBLOCKS = 6;
208210
static const unsigned int DEFAULT_CHECKLEVEL = 3;

0 commit comments

Comments
 (0)