Class BlockLocator

java.lang.Object
org.bitcoinj.core.BlockLocator

public final class BlockLocator extends Object
Represents Block Locator in GetBlocks and GetHeaders messages
  • Constructor Details

    • BlockLocator

      public BlockLocator()
    • BlockLocator

      public BlockLocator(com.google.common.collect.ImmutableList<Sha256Hash> hashes)
      Creates a Block locator with defined list of hashes.
  • Method Details

    • add

      public BlockLocator add(Sha256Hash hash)
      Add a Sha256Hash to a newly created block locator.
    • size

      public int size()
      Returns the number of hashes in this block locator.
    • getHashes

      public 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 String toString()
      Overrides:
      toString in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object