Package org.bitcoinj.core
Class GetBlocksMessage
java.lang.Object
org.bitcoinj.core.Message
org.bitcoinj.core.GetBlocksMessage
- 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
Fields inherited from class org.bitcoinj.core.Message
cursor, length, MAX_SIZE, offset, params, payload, recached, serializer, UNKNOWN_LENGTH
-
Constructor Summary
ConstructorDescriptionGetBlocksMessage
(NetworkParameters params, byte[] payload) GetBlocksMessage
(NetworkParameters params, BlockLocator locator, Sha256Hash stopHash) -
Method Summary
Modifier and TypeMethodDescriptionprotected void
bitcoinSerializeToStream
(OutputStream stream) Serializes this message to the provided stream.boolean
int
hashCode()
protected void
parse()
toString()
Methods inherited from class org.bitcoinj.core.Message
adjustLength, bitcoinSerialize, bitcoinSerialize, getHash, getMessageSize, getParams, hasMoreBytes, isCached, isRecached, readByte, readByteArray, readBytes, readHash, readInt64, readStr, readUint32, readUint64, readVarInt, readVarInt, setSerializer, unCache, unsafeBitcoinSerialize
-
Field Details
-
version
protected long version -
locator
-
stopHash
-
-
Constructor Details
-
GetBlocksMessage
-
GetBlocksMessage
- Throws:
ProtocolException
-
-
Method Details
-
parse
- Specified by:
parse
in classMessage
- Throws:
ProtocolException
-
getLocator
-
getStopHash
-
toString
-
bitcoinSerializeToStream
Description copied from class:Message
Serializes this message to the provided stream. If you just want the raw bytes use bitcoinSerialize().- Overrides:
bitcoinSerializeToStream
in classMessage
- Throws:
IOException
-
equals
-
hashCode
public int hashCode()
-