Object/Class

com.alexdupre.bitcoincash

MerkleBlock

Related Docs: class MerkleBlock | package bitcoincash

Permalink

object MerkleBlock extends BtcSerializer[MerkleBlock] with Serializable

Linear Supertypes
Serializable, Serializable, BtcSerializer[MerkleBlock], AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. MerkleBlock
  2. Serializable
  3. Serializable
  4. BtcSerializer
  5. AnyRef
  6. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  5. def calcTreeWidth(leafCount: Int, height: Int): Int

    Permalink

    leafCount

    total number of leaf nodes

    height

    tree height (0 == bottom == leaf nodes)

    returns

    the number of nodes at the given height

  6. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  7. def computeRoot(count: Int, height: Int, pos: Int, hashes: Seq[BinaryData], bits: List[Boolean], matched: List[(BinaryData, Int)]): (BinaryData, List[(BinaryData, Int)], Seq[BinaryData], List[Boolean])

    Permalink

    compute the root hash of a partial merkle tree: Read a bit from the flag bit list: If it is '0': Read a hash from the hashes list, and return it as this node's hash.

    compute the root hash of a partial merkle tree: Read a bit from the flag bit list: If it is '0': Read a hash from the hashes list, and return it as this node's hash. If it is '1' and this is a leaf node: Read a hash from the hashes list, store it as a matched txid, and return it as this node's hash. If it is '1' and this is an internal node: Descend into its left child tree, and store its computed hash as L. If this node has a right child as well: Descend into its right child, and store its computed hash as R. If L == R, the partial merkle tree object is invalid. Return Hash(L || R). If this node has no right child, return Hash(L || L).

    count

    total number of leaves

    height

    current height (0 == bottom of the tree == leaf nodes)

    pos

    current position at this height, 0 = first node from the left

    hashes

    remaining hashes to read from

    bits

    remaining flag bits to read from

    returns

    a (hash, matched, remaining_hashes, remaining_bits) tuple where:

    • hash is the hash at position (height, pos)
    • matched is a list of matched txids and their position in the original block
    • remaining_hashes and remaining_bits are hashes and bits that have not been used
  8. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  9. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  10. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  11. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  12. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  13. def isBitSet(byte: Byte, bit: Int): Boolean

    Permalink
  14. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  15. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  16. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  17. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  18. def read(input: InputStream, protocolVersion: Long): MerkleBlock

    Permalink

    read a message from a stream

    read a message from a stream

    returns

    a deserialized message

    Definition Classes
    MerkleBlockBtcSerializer
  19. def read(in: String): MerkleBlock

    Permalink
    Definition Classes
    BtcSerializer
  20. def read(in: String, protocolVersion: Long): MerkleBlock

    Permalink

    read a message from a hex string

    read a message from a hex string

    in

    message binary data in hex format

    returns

    a deserialized message of type T

    Definition Classes
    BtcSerializer
  21. def read(in: Seq[Byte]): MerkleBlock

    Permalink
    Definition Classes
    BtcSerializer
  22. def read(in: Seq[Byte], protocolVersion: Long): MerkleBlock

    Permalink

    read a message from a byte array

    read a message from a byte array

    in

    serialized message

    returns

    a deserialized message

    Definition Classes
    BtcSerializer
  23. def read(in: InputStream): MerkleBlock

    Permalink
    Definition Classes
    BtcSerializer
  24. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  25. def toBits(flags: BinaryData): List[Boolean]

    Permalink
  26. def toBits(byte: Byte): List[Boolean]

    Permalink
  27. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  28. def topHeight(leafCount: Int): Int

    Permalink

    leafCount

    ttoal number of leaf nodes

    returns

    the height of the root node. For example if yo have 5 leaf nodes, the height of the root node is 3.

  29. def validate(t: MerkleBlock): Unit

    Permalink
    Definition Classes
    BtcSerializer
  30. def verify(merkleBlock: MerkleBlock): Unit

    Permalink
  31. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  32. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  33. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  34. def write(input: MerkleBlock, out: OutputStream, protocolVersion: Long): Unit

    Permalink

    write a message to a stream

    write a message to a stream

    out

    output stream

    Definition Classes
    MerkleBlockBtcSerializer
  35. def write(t: MerkleBlock): BinaryData

    Permalink
    Definition Classes
    BtcSerializer
  36. def write(t: MerkleBlock, protocolVersion: Long): BinaryData

    Permalink

    write a message to a byte array

    write a message to a byte array

    t

    message

    returns

    a serialized message

    Definition Classes
    BtcSerializer
  37. def write(t: MerkleBlock, out: OutputStream): Unit

    Permalink
    Definition Classes
    BtcSerializer

Inherited from Serializable

Inherited from Serializable

Inherited from BtcSerializer[MerkleBlock]

Inherited from AnyRef

Inherited from Any

Ungrouped