Package org.bitcoinj.core
Class BlockLocator
- java.lang.Object
-
- org.bitcoinj.core.BlockLocator
-
public final class BlockLocator extends java.lang.ObjectRepresents Block Locator in GetBlocks and GetHeaders messages
-
-
Constructor Summary
Constructors Constructor Description BlockLocator()BlockLocator(com.google.common.collect.ImmutableList<Sha256Hash> hashes)Creates a Block locator with defined list of hashes.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description BlockLocatoradd(Sha256Hash hash)Add aSha256Hashto a newly created block locator.booleanequals(java.lang.Object o)Sha256Hashget(int i)Get hash by index from this block locator.java.util.List<Sha256Hash>getHashes()Returns List of Block locator hashes.inthashCode()intsize()Returns the number of hashes in this block locator.java.lang.StringtoString()
-
-
-
Constructor Detail
-
BlockLocator
public BlockLocator()
-
BlockLocator
public BlockLocator(com.google.common.collect.ImmutableList<Sha256Hash> hashes)
Creates a Block locator with defined list of hashes.
-
-
Method Detail
-
add
public BlockLocator add(Sha256Hash hash)
Add aSha256Hashto 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:
toStringin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
-