Ejemplo n.º 1
0
        protected virtual byte[] SerializeHeader(uint nTime, string nonce)
        {
            var blockHeader = new ZCashBlockHeader
            {
                Version        = (int)BlockTemplate.Version,
                Bits           = new Target(Encoders.Hex.DecodeData(BlockTemplate.Bits)),
                HashPrevBlock  = uint256.Parse(BlockTemplate.PreviousBlockhash),
                HashMerkleRoot = new uint256(merkleRoot),
                NTime          = nTime,
                Nonce          = nonce
            };

            return(blockHeader.ToBytes());
        }
Ejemplo n.º 2
0
        protected virtual byte[] SerializeHeader(uint nTime, string nonce)
        {
            var blockHeader = new ZCashBlockHeader
            {
                Version        = (int)BlockTemplate.Version,
                Bits           = new Target(Encoders.Hex.DecodeData(BlockTemplate.Bits)),
                HashPrevBlock  = uint256.Parse(BlockTemplate.PreviousBlockhash),
                HashMerkleRoot = new uint256(merkleRoot),
                NTime          = nTime,
                Nonce          = nonce
            };

            if (isSaplingActive && !string.IsNullOrEmpty(BlockTemplate.FinalSaplingRootHash))
            {
                blockHeader.HashReserved = BlockTemplate.FinalSaplingRootHash.HexToByteArray().ReverseArray();
            }

            return(blockHeader.ToBytes());
        }