Ejemplo n.º 1
0
 /// <summary>
 /// constructor
 /// </summary>
 /// <param name="hash">branch hash</param>
 public TapBranch(ByteData256 hash)
 {
     if (hash is null)
     {
         throw new ArgumentNullException(nameof(hash));
     }
     if (hash.GetSize() != 32)
     {
         CfdCommon.ThrowError(CfdErrorCode.IllegalArgumentError, "Invalid branch hash size.");
     }
     treeString  = hash.ToHexString();
     targetNodes = Array.Empty <ByteData256>();
     branches    = Array.Empty <TapBranch>();
     topHash     = hash;
     tapscript   = new Script();
     leafVersion = 0;
 }