com.google.bitcoin.core
Class GetDataMessage
java.lang.Object
com.google.bitcoin.core.Message
com.google.bitcoin.core.ListMessage
com.google.bitcoin.core.GetDataMessage
- All Implemented Interfaces:
- Serializable
public class GetDataMessage
- extends ListMessage
Represents the "getdata" P2P network message, which requests the contents of blocks or transactions given their
hashes.
- See Also:
- Serialized Form
| Fields inherited from class com.google.bitcoin.core.Message |
bytes, checksum, cursor, length, MAX_SIZE, offset, params, parsed, parseLazy, parseRetain, protocolVersion, recached, UNKNOWN_LENGTH |
| Methods inherited from class com.google.bitcoin.core.Message |
adjustLength, bitcoinSerialize, bitcoinSerialize, ensureParsed, getHash, getMessageSize, getParams, isCached, isParsed, isRecached, maybeParse, unCache, unsafeBitcoinSerialize |
GetDataMessage
public GetDataMessage(NetworkParameters params,
byte[] payloadBytes)
throws ProtocolException
- Throws:
ProtocolException
GetDataMessage
public GetDataMessage(NetworkParameters params,
byte[] msg,
boolean parseLazy,
boolean parseRetain,
int length)
throws ProtocolException
- Deserializes a 'getdata' message.
- Parameters:
params - NetworkParameters object.msg - Bitcoin protocol formatted byte array containing message content.parseLazy - Whether to perform a full parse immediately or delay until a read is requested.parseRetain - Whether to retain the backing byte array for quick reserialization.
If true and the backing byte array is invalidated due to modification of a field then
the cached bytes may be repopulated and retained if the message is serialized again in the future.length - The length of message if known. Usually this is provided when deserializing of the wire
as the length will be provided as part of the header. If unknown then set to Message.UNKNOWN_LENGTH
- Throws:
ProtocolException
GetDataMessage
public GetDataMessage(NetworkParameters params)
addTransaction
public void addTransaction(Sha256Hash hash)
addBlock
public void addBlock(Sha256Hash hash)
Copyright © 2014. All rights reserved.