mirror of
https://github.com/bitcoinj/bitcoinj.git
synced 2025-01-18 21:32:35 +01:00
VersionMessage: Parse NODE_WITNESS service flag.
This commit is contained in:
parent
7f5b6753f5
commit
4722b48628
@ -50,6 +50,8 @@ public class VersionMessage extends Message {
|
||||
public static final int NODE_NETWORK = 1 << 0;
|
||||
/** A service bit that denotes whether the peer supports the getutxos message or not. */
|
||||
public static final int NODE_GETUTXOS = 1 << 1;
|
||||
/** Indicates that a node can be asked for blocks and transactions including witness data. */
|
||||
public static final int NODE_WITNESS = 1 << 3;
|
||||
/** A service bit used by Bitcoin-ABC to announce Bitcoin Cash nodes. */
|
||||
public static final int NODE_BITCOIN_CASH = 1 << 5;
|
||||
|
||||
@ -293,4 +295,9 @@ public class VersionMessage extends Message {
|
||||
return clientVersion >= GetUTXOsMessage.MIN_PROTOCOL_VERSION &&
|
||||
(localServices & NODE_GETUTXOS) == NODE_GETUTXOS;
|
||||
}
|
||||
|
||||
/** Returns true if a peer can be asked for blocks and transactions including witness data. */
|
||||
public boolean isWitnessSupported() {
|
||||
return (localServices & NODE_WITNESS) == NODE_WITNESS;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user