me.edwards.des.net.packet
Class PacketGetBlocks
java.lang.Object
me.edwards.des.net.packet.Packet
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
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 java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
hash
private java.lang.String hash
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
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