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 List<Sha256Hash> |
locator |
protected Sha256Hash |
stopHash |
protected long |
version |
cursor, length, MAX_SIZE, offset, params, payload, protocolVersion, recached, serializer, UNKNOWN_LENGTH| Constructor and Description |
|---|
GetBlocksMessage(NetworkParameters params,
byte[] payload) |
GetBlocksMessage(NetworkParameters params,
List<Sha256Hash> locator,
Sha256Hash stopHash) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
bitcoinSerializeToStream(OutputStream stream)
Serializes this message to the provided stream.
|
boolean |
equals(Object o) |
List<Sha256Hash> |
getLocator() |
Sha256Hash |
getStopHash() |
int |
hashCode() |
protected void |
parse() |
String |
toString() |
adjustLength, bitcoinSerialize, bitcoinSerialize, getHash, getMessageSize, getParams, hasMoreBytes, isCached, isRecached, readByteArray, readBytes, readHash, readInt64, readStr, readUint32, readUint64, readVarInt, readVarInt, unCache, unsafeBitcoinSerializeprotected long version
protected List<Sha256Hash> locator
protected Sha256Hash stopHash
public GetBlocksMessage(NetworkParameters params, List<Sha256Hash> locator, Sha256Hash stopHash)
public GetBlocksMessage(NetworkParameters params, byte[] payload) throws ProtocolException
ProtocolExceptionprotected void parse()
throws ProtocolException
parse in class MessageProtocolExceptionpublic List<Sha256Hash> getLocator()
public Sha256Hash getStopHash()
protected void bitcoinSerializeToStream(OutputStream stream) throws IOException
MessagebitcoinSerializeToStream in class MessageIOExceptionCopyright © 2018. All rights reserved.