From 139664f17eb7ff22f39b4c339e03b67f529c3793 Mon Sep 17 00:00:00 2001 From: Andreas Schildbach Date: Wed, 10 Jan 2024 23:01:25 +0100 Subject: [PATCH] Services: add NODE_P2P_V2 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 d04cfa6760d..19143e68237 100644 --- a/core/src/main/java/org/bitcoinj/core/VersionMessage.java +++ b/core/src/main/java/org/bitcoinj/core/VersionMessage.java @@ -58,6 +58,8 @@ public class VersionMessage extends Message { public static final int NODE_WITNESS = 1 << 3; /** 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. */ + public static final int NODE_P2P_V2 = 1 << 11; /** A service bit used by Bitcoin-ABC to announce Bitcoin Cash nodes. */ public static final int NODE_BITCOIN_CASH = 1 << 5; @@ -333,6 +335,10 @@ public static String toStringServices(long services) { strings.add("NETWORK_LIMITED"); services &= ~NODE_NETWORK_LIMITED; } + if ((services & NODE_P2P_V2) == NODE_P2P_V2) { + strings.add("P2P_V2"); + services &= ~NODE_P2P_V2; + } if (services != 0) strings.add("remaining: " + Long.toBinaryString(services)); return Joiner.on(", ").join(strings);