Exemplo n.º 1
0
        private void ___writeHeader(Stream stream)
        {
            // try for cached write first
            byte[] cachedHeader = getCachedHeader();
            if (cachedHeader != null)
            {
                stream.Write(cachedHeader);
                return;
            }

            EnsureParsedHeader();
            stream.Write(Version.ToByteArrayLe());
            stream.Write(PreviousBlockHash.Bytes.ReverseBytes());
            stream.Write(MerkleRoot.Bytes.ReverseBytes());
            stream.Write(TimeSeconds.ToByteArrayLe());
            stream.Write(DifficultyTarget.ToByteArrayLe());
            stream.Write(Nonce.ToByteArrayLe());
        }