Class GetDataMessage


  • 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.

    • Constructor Detail

      • GetDataMessage

        public GetDataMessage​(NetworkParameters params,
                              byte[] payload,
                              MessageSerializer serializer,
                              int length)
                       throws ProtocolException
        Deserializes a 'getdata' message.
        Parameters:
        params - NetworkParameters object.
        payload - Bitcoin protocol formatted byte array containing message content.
        serializer - the serializer to use for this message.
        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
    • Method Detail

      • 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)