Package org.bitcoinj.core
Class BlockLocator
- java.lang.Object
-
- org.bitcoinj.core.BlockLocator
-
public final class BlockLocator extends java.lang.Object
Represents Block Locator in GetBlocks and GetHeaders messages
-
-
Constructor Summary
Constructors Constructor Description BlockLocator()
BlockLocator(java.util.List<Sha256Hash> hashes)
Creates a Block locator with defined list of hashes.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description BlockLocator
add(Sha256Hash hash)
Add aSha256Hash
to a newly created block locator.boolean
equals(java.lang.Object o)
Sha256Hash
get(int i)
Get hash by index from this block locator.java.util.List<Sha256Hash>
getHashes()
Returns List of Block locator hashes.int
hashCode()
int
size()
Returns the number of hashes in this block locator.java.lang.String
toString()
-
-
-
Constructor Detail
-
BlockLocator
public BlockLocator()
-
BlockLocator
public BlockLocator(java.util.List<Sha256Hash> hashes)
Creates a Block locator with defined list of hashes.
-
-
Method Detail
-
add
public BlockLocator add(Sha256Hash hash)
Add aSha256Hash
to a newly created block locator.
-
size
public int size()
Returns the number of hashes in this block locator.
-
getHashes
public java.util.List<Sha256Hash> getHashes()
Returns List of Block locator hashes.
-
get
public Sha256Hash get(int i)
Get hash by index from this block locator.
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
-