From 0cce51cb8350ff6a9dc5cd15cf62ca7139b98de0 Mon Sep 17 00:00:00 2001 From: Andreas Schildbach Date: Wed, 10 Jan 2024 22:58:33 +0100 Subject: [PATCH] Services: add NODE_COMPACT_FILTERS service bit --- core/src/main/java/org/bitcoinj/core/VersionMessage.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/core/src/main/java/org/bitcoinj/core/VersionMessage.java b/core/src/main/java/org/bitcoinj/core/VersionMessage.java index 19143e68237..a4704bacfb4 100644 --- a/core/src/main/java/org/bitcoinj/core/VersionMessage.java +++ b/core/src/main/java/org/bitcoinj/core/VersionMessage.java @@ -56,6 +56,8 @@ public class VersionMessage extends Message { public static final int NODE_BLOOM = 1 << 2; /** Indicates that a node can be asked for blocks and transactions including witness data. */ public static final int NODE_WITNESS = 1 << 3; + /** Indicates the node will service basic block filter requests (BIP157, BIP158). */ + public static final int NODE_COMPACT_FILTERS = 1 << 6; /** A service bit that denotes whether the peer has at least the last two days worth of blockchain (BIP159). */ public static final int NODE_NETWORK_LIMITED = 1 << 10; /** Indicates the node supports BIP324 transport. */ @@ -331,6 +333,10 @@ public static String toStringServices(long services) { strings.add("WITNESS"); services &= ~NODE_WITNESS; } + if ((services & NODE_COMPACT_FILTERS) == NODE_COMPACT_FILTERS) { + strings.add("COMPACT_FILTERS"); + services &= ~NODE_COMPACT_FILTERS; + } if ((services & NODE_NETWORK_LIMITED) == NODE_NETWORK_LIMITED) { strings.add("NETWORK_LIMITED"); services &= ~NODE_NETWORK_LIMITED;