PartialMerkleTree.Companion
Keywords: net.corda.core.crypto.PartialMerkleTree.Companion class
Date: 2023-09-18

net.corda.core.crypto

## Class PartialMerkleTree.Companion

- net.corda.core.crypto.PartialMerkleTree.Companion

- Enclosing class:
    PartialMerkleTree

      public static class PartialMerkleTree.Companion

- - ### Method Detail

    - #### build

          @NotNull
          public PartialMerkleTree build(@NotNull
                                                  MerkleTree merkleRoot,
                                                  @NotNull
                                                  java.util.List<? extends net.corda.core.crypto.SecureHash> includeHashes)

      Parameters:
        `merkleRoot` - Root of full Merkle tree.
        `includeHashes` - Hashes that should be included in a partial tree.
      Returns:
        Partial Merkle tree root.

    - #### rootAndUsedHashes

          @NotNull
          public SecureHash rootAndUsedHashes(@NotNull
                                                       net.corda.core.crypto.PartialMerkleTree.PartialTree node,
                                                       @NotNull
                                                       java.util.List<net.corda.core.crypto.SecureHash> usedHashes)

      Recursive calculation of root of this partial tree. Modifies usedHashes to later check for inclusion with hashes provided.

      Parameters:
        `node` - the partial Merkle tree for which we want to calculate the Merkle root.
        `usedHashes` - a mutable list that at the end of this recursive algorithm, it will consist of the included leaves (hashes of the visible components).
      Returns:
        the root `class SecureHash` of this partial Merkle tree.