me.edwards.des.net.packet
Class PacketGetBlocks

java.lang.Object
  extended by me.edwards.des.net.packet.Packet
      extended by me.edwards.des.net.packet.PacketGetBlocks

public class PacketGetBlocks
extends Packet

Get Blocks Packet

This packet is sent to request Block information from other Nodes during the bootstrap process.

Created on: Oct 17, 2015 at 9:12:01 AM

Author:
Matthew Edwards

Nested Class Summary
 
Nested classes/interfaces inherited from class me.edwards.des.net.packet.Packet
Packet.PacketTypes
 
Field Summary
private  java.lang.String hash
           
 
Constructor Summary
PacketGetBlocks(byte[] binary)
          Creates new PacketGetBlocks from binary data
PacketGetBlocks(java.lang.String hash)
          Creates new PacketGetBlocks
 
Method Summary
 byte[] getBinary()
          Returns the binary payload of this Packet as a byte array.
 java.lang.String getHash()
          Returns the oldest hash of the Block requested by this packet.
 
Methods inherited from class me.edwards.des.net.packet.Packet
getID, lookup, toHex, toString, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

hash

private java.lang.String hash
Constructor Detail

PacketGetBlocks

public PacketGetBlocks(java.lang.String hash)
Creates new PacketGetBlocks

Parameters:
hash - Hash of the oldest Block requested

PacketGetBlocks

public PacketGetBlocks(byte[] binary)
Creates new PacketGetBlocks from binary data

Parameters:
binary - Packet binary data as byte array
Method Detail

getHash

public java.lang.String getHash()
Returns the oldest hash of the Block requested by this packet.

Returns:
32-digit hexadecimal hash of the oldest Block requested

getBinary

public byte[] getBinary()
Description copied from class: Packet
Returns the binary payload of this Packet as a byte array.

Specified by:
getBinary in class Packet
Returns:
Binary payload as a byte array