Esempio n. 1
0
 /// <summary>
 /// New nodes are always created on the left branch from their parent node (when they get one).
 /// They always start with a valid left hash (either Tx hash or left subtree hash.
 /// They always start without a valid right hash.
 /// </summary>
 public KzMerkleTreeNode(KzUInt256 newLeftHash, KzMerkleTreeNode child)
 {
     SetLeftHash(newLeftHash);
     if (child != null)
     {
         child.Parent = this;
     }
 }
Esempio n. 2
0
        KzUInt256 ComputeHash(KzMerkleTreeNode n)
        {
            // This ToArray call could be eliminated.
            var h = new KzUInt256();

            KzHashes.HASH256(n.LeftRightHashes, h.Span);
            return(h);
        }