Esempio n. 1
0
        public static BlockPosData Parse(PosParameters pos)
        {
            var posData = new BlockPosData
            {
                Flags           = pos.Flags.ToString(),
                Mint            = pos.Mint,
                ProofHash       = pos.HashProof.ToString(),
                StakeModifier   = pos.StakeModifier.ToString(),
                StakeModifierV2 = pos.StakeModifierV2.ToString(),
                StakeTime       = pos.StakeTime
            };


            return(posData);
        }
Esempio n. 2
0
        public static BlockHeaderData Parse(BlockHeader header)
        {
            var headerData = new BlockHeaderData
            {
                PowHash       = header.GetPoWHash().ToString(),
                Version       = header.Version,
                Bits          = header.Bits.ToUInt256().ToString(),
                Difficulty    = header.Bits.Difficulty,
                BlockTime     = header.BlockTime.ToUnixTimeSeconds(),
                MerkleRoot    = header.HashMerkleRoot.ToString(),
                HashPrevBlock = header.HashPrevBlock.ToString(),
                Nonce         = header.Nonce,
                Time          = header.Time,
                PosData       = BlockPosData.Parse(header.PosParameters)
            };

            return(headerData);
        }