Пример #1
0
        public uint256 GetHash()
        {
            uint256 h      = null;
            var     hashes = _Hashes;

            if (hashes != null)
            {
                h = hashes[0];
            }
            if (h != null)
            {
                return(h);
            }

            using (var hs = CreateHashStream())
            {
                var stream = new BitcoinStream(hs, true);
                stream.SerializationTypeScope(SerializationType.Hash);
                this.ReadWrite(stream);
                h = hs.GetHash();
            }

            hashes = _Hashes;
            if (hashes != null)
            {
                hashes[0] = h;
            }
            return(h);
        }