Package org.bitcoinj.core
Class GetBlocksMessage
java.lang.Object
org.bitcoinj.core.BaseMessage
org.bitcoinj.core.GetBlocksMessage
- All Implemented Interfaces:
Message
- Direct Known Subclasses:
GetHeadersMessage
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.
-
Field Summary
-
Constructor Summary
ConstructorDescriptionGetBlocksMessage
(long protocolVersion, BlockLocator locator, Sha256Hash stopHash) -
Method Summary
Modifier and TypeMethodDescriptionprotected void
bitcoinSerializeToStream
(OutputStream stream) Serializes this message to the provided stream.boolean
int
hashCode()
static GetBlocksMessage
read
(ByteBuffer payload) Deserialize this message from a given payload.toString()
Methods inherited from class org.bitcoinj.core.BaseMessage
messageSize, serialize
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.bitcoinj.core.Message
bitcoinSerialize, getMessageSize, unsafeBitcoinSerialize
-
Field Details
-
version
protected long version -
locator
-
stopHash
-
-
Constructor Details
-
GetBlocksMessage
-
-
Method Details
-
read
public static GetBlocksMessage read(ByteBuffer payload) throws BufferUnderflowException, ProtocolException Deserialize this message from a given payload.- Parameters:
payload
- payload to deserialize from- Returns:
- read message
- Throws:
BufferUnderflowException
- if the read message extends beyond the remaining bytes of the payloadProtocolException
-
getLocator
-
getStopHash
-
toString
-
bitcoinSerializeToStream
Description copied from class:BaseMessage
Serializes this message to the provided stream. If you just want the raw bytes useBaseMessage.serialize()
.- Specified by:
bitcoinSerializeToStream
in classBaseMessage
- Throws:
IOException
-
equals
-
hashCode
public int hashCode()
-