|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.google.bitcoin.core.Message
com.google.bitcoin.core.VersionMessage
public class VersionMessage
Field Summary | |
---|---|
long |
bestHeight
How many blocks are in the chain, according to the other side. |
int |
clientVersion
The version number of the protocol spoken. |
long |
localServices
Flags defining what is supported. |
PeerAddress |
myAddr
What the other side believes the address of this program is. |
static int |
NODE_NETWORK
A services flag that denotes whether the peer has a copy of the block chain or not. |
String |
subVer
An additional string that today the official client sets to the empty string. |
PeerAddress |
theirAddr
What the other side believes their own address is. |
long |
time
What the other side believes the current time to be, in seconds. |
Fields inherited from class com.google.bitcoin.core.Message |
---|
bytes, cursor, MAX_SIZE, offset, params, protocolVersion |
Constructor Summary | |
---|---|
VersionMessage(NetworkParameters params,
byte[] msg)
|
|
VersionMessage(NetworkParameters params,
int newBestHeight)
|
Method Summary | |
---|---|
void |
bitcoinSerializeToStream(OutputStream buf)
Serializes this message to the provided stream. |
boolean |
hasBlockChain()
Returns true if the version message indicates the sender has a full copy of the block chain, or if it's running in client mode (only has the headers). |
void |
parse()
|
Methods inherited from class com.google.bitcoin.core.Message |
---|
bitcoinSerialize |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int NODE_NETWORK
public int clientVersion
public long localServices
NODE_NETWORK
is the only flag defined.
public long time
public PeerAddress myAddr
public PeerAddress theirAddr
public String subVer
public long bestHeight
Constructor Detail |
---|
public VersionMessage(NetworkParameters params, byte[] msg) throws ProtocolException
ProtocolException
public VersionMessage(NetworkParameters params, int newBestHeight)
Method Detail |
---|
public void parse() throws ProtocolException
ProtocolException
public void bitcoinSerializeToStream(OutputStream buf) throws IOException
Message
IOException
public boolean hasBlockChain()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |