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, unsafeBitcoinSerializeprotected long version
protected BlockLocator locator
protected Sha256Hash stopHash
public GetBlocksMessage(NetworkParameters params, BlockLocator locator, Sha256Hash stopHash)
public GetBlocksMessage(NetworkParameters params, byte[] payload) throws ProtocolException
ProtocolExceptionprotected void parse()
throws ProtocolException
parse in class MessageProtocolExceptionpublic BlockLocator getLocator()
public Sha256Hash getStopHash()
public java.lang.String toString()
toString in class java.lang.Objectprotected void bitcoinSerializeToStream(java.io.OutputStream stream)
throws java.io.IOException
MessagebitcoinSerializeToStream in class Messagejava.io.IOExceptionpublic boolean equals(java.lang.Object o)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Object