public class GetBlocksMessage extends Message
Represents the "getblocks" P2P network message, which requests the hashes of the parts of the block chain we're
missing. Those blocks can then be downloaded with a GetDataMessage
.
Instances of this class are not safe for use by multiple threads.
Modifier and Type | Field and Description |
---|---|
protected BlockLocator |
locator |
protected Sha256Hash |
stopHash |
protected long |
version |
cursor, length, MAX_SIZE, offset, params, payload, recached, serializer, UNKNOWN_LENGTH
Constructor and Description |
---|
GetBlocksMessage(NetworkParameters params,
BlockLocator locator,
Sha256Hash stopHash) |
GetBlocksMessage(NetworkParameters params,
byte[] payload) |
Modifier and Type | Method and Description |
---|---|
protected void |
bitcoinSerializeToStream(java.io.OutputStream stream)
Serializes this message to the provided stream.
|
boolean |
equals(java.lang.Object o) |
BlockLocator |
getLocator() |
Sha256Hash |
getStopHash() |
int |
hashCode() |
protected void |
parse() |
java.lang.String |
toString() |
adjustLength, bitcoinSerialize, bitcoinSerialize, getHash, getMessageSize, getParams, hasMoreBytes, isCached, isRecached, readByte, readByteArray, readBytes, readHash, readInt64, readStr, readUint32, readUint64, readVarInt, readVarInt, setSerializer, unCache, unsafeBitcoinSerialize
protected long version
protected BlockLocator locator
protected Sha256Hash stopHash
public GetBlocksMessage(NetworkParameters params, BlockLocator locator, Sha256Hash stopHash)
public GetBlocksMessage(NetworkParameters params, byte[] payload) throws ProtocolException
ProtocolException
protected void parse() throws ProtocolException
parse
in class Message
ProtocolException
public BlockLocator getLocator()
public Sha256Hash getStopHash()
public java.lang.String toString()
toString
in class java.lang.Object
protected void bitcoinSerializeToStream(java.io.OutputStream stream) throws java.io.IOException
Message
bitcoinSerializeToStream
in class Message
java.io.IOException
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object