Example #1
0
        public override uint256 GetPoWHash()
        {
            byte[] serialized;

            using (var ms = new MemoryStream())
            {
                this.ReadWriteHashingStream(new BitcoinStream(ms, true));
                serialized = ms.ToArray();
            }

            return(Sha512T.GetHash(serialized));
        }
Example #2
0
        private static bool CheckProofOfWork(byte[] header, uint nonce, uint256 bits)
        {
            var bytes = BitConverter.GetBytes(nonce);

            header[76] = bytes[0];
            header[77] = bytes[1];
            header[78] = bytes[2];
            header[79] = bytes[3];

            var headerHash = Sha512T.GetHash(header);

            var res = headerHash <= bits;

            return(res);
        }
Example #3
0
            public override uint256 GetPoWHash()
            {
                var bytes = this.ToBytes();

                return(new uint256(Sha512T.GetHash(this.ToBytes(), 0, bytes.Length)));
            }