mirror of
https://github.com/Qortal/altcoinj.git
synced 2025-07-31 20:11:23 +00:00
VersionMessage: Parse NODE_WITNESS service flag.
This commit is contained in:
committed by
Andreas Schildbach
parent
7f5b6753f5
commit
4722b48628
@@ -50,6 +50,8 @@ public class VersionMessage extends Message {
|
|||||||
public static final int NODE_NETWORK = 1 << 0;
|
public static final int NODE_NETWORK = 1 << 0;
|
||||||
/** A service bit that denotes whether the peer supports the getutxos message or not. */
|
/** A service bit that denotes whether the peer supports the getutxos message or not. */
|
||||||
public static final int NODE_GETUTXOS = 1 << 1;
|
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. */
|
/** A service bit used by Bitcoin-ABC to announce Bitcoin Cash nodes. */
|
||||||
public static final int NODE_BITCOIN_CASH = 1 << 5;
|
public static final int NODE_BITCOIN_CASH = 1 << 5;
|
||||||
|
|
||||||
@@ -293,4 +295,9 @@ public class VersionMessage extends Message {
|
|||||||
return clientVersion >= GetUTXOsMessage.MIN_PROTOCOL_VERSION &&
|
return clientVersion >= GetUTXOsMessage.MIN_PROTOCOL_VERSION &&
|
||||||
(localServices & NODE_GETUTXOS) == NODE_GETUTXOS;
|
(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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user