Package org.bitcoinj.core
Class GetDataMessage
- java.lang.Object
-
- org.bitcoinj.core.BaseMessage
-
- org.bitcoinj.core.ListMessage
-
- org.bitcoinj.core.GetDataMessage
-
- All Implemented Interfaces:
Message
public class GetDataMessage extends ListMessage
Represents the "getdata" P2P network message, which requests the contents of blocks or transactions given their hashes.
Instances of this class are not safe for use by multiple threads.
-
-
Field Summary
-
Fields inherited from class org.bitcoinj.core.ListMessage
items, MAX_INVENTORY_ITEMS
-
-
Constructor Summary
Constructors Constructor Description GetDataMessage()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addBlock(Sha256Hash hash, boolean includeWitness)
void
addFilteredBlock(Sha256Hash hash)
void
addTransaction(Sha256Hash hash, boolean includeWitness)
Sha256Hash
getHashOf(int i)
static GetDataMessage
read(java.nio.ByteBuffer payload)
Deserialize this message from a given payload.-
Methods inherited from class org.bitcoinj.core.ListMessage
addItem, bitcoinSerializeToStream, equals, getItems, hashCode, readItems, removeItem, 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
-
-
-
-
Method Detail
-
read
public static GetDataMessage read(java.nio.ByteBuffer payload) throws java.nio.BufferUnderflowException, ProtocolException
Deserialize this message from a given payload.- Parameters:
payload
- payload to deserialize from- Returns:
- read message
- Throws:
java.nio.BufferUnderflowException
- if the read message extends beyond the remaining bytes of the payloadProtocolException
-
addTransaction
public void addTransaction(Sha256Hash hash, boolean includeWitness)
-
addBlock
public void addBlock(Sha256Hash hash, boolean includeWitness)
-
addFilteredBlock
public void addFilteredBlock(Sha256Hash hash)
-
getHashOf
public Sha256Hash getHashOf(int i)
-
-