aboutsummaryrefslogtreecommitdiff
path: root/src/init.cpp
diff options
context:
space:
mode:
authorJim Posen <jim.posen@gmail.com>2020-05-04 11:13:13 -0400
committerJohn Newbery <john@johnnewbery.com>2020-05-31 23:01:06 -0400
commit132b30d9c84f2a8053714a438f227b583a89a9ea (patch)
treefbabe20e488f17a3d1d58724d772d5381723b256 /src/init.cpp
parentb3fbc94d4f2937bb682f2766cc9a8d4fde328a3f (diff)
downloadbitcoin-132b30d9c84f2a8053714a438f227b583a89a9ea.tar.xz
[net] Signal NODE_COMPACT_FILTERS if we're serving compact filters.
If -peerblockfilters is configured, signal the NODE_COMPACT_FILTERS service bit to indicate that we are able to serve compact block filters, headers and checkpoints.
Diffstat (limited to 'src/init.cpp')
-rw-r--r--src/init.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/init.cpp b/src/init.cpp
index 37e6251295..24ddaac066 100644
--- a/src/init.cpp
+++ b/src/init.cpp
@@ -996,11 +996,13 @@ bool AppInitParameterInteraction()
}
}
- // Basic filters are the only supported filters. The basic filters index must be enabled
- // to serve compact filters
- if (gArgs.GetBoolArg("-peerblockfilters", DEFAULT_PEERBLOCKFILTERS) &&
- g_enabled_filter_types.count(BlockFilterType::BASIC) != 1) {
- return InitError(_("Cannot set -peerblockfilters without -blockfilterindex."));
+ // Signal NODE_COMPACT_FILTERS if peerblockfilters and basic filters index are both enabled.
+ if (gArgs.GetBoolArg("-peerblockfilters", DEFAULT_PEERBLOCKFILTERS)) {
+ if (g_enabled_filter_types.count(BlockFilterType::BASIC) != 1) {
+ return InitError(_("Cannot set -peerblockfilters without -blockfilterindex."));
+ }
+
+ nLocalServices = ServiceFlags(nLocalServices | NODE_COMPACT_FILTERS);
}
// if using block pruning, then disallow txindex