Esempio n. 1
0
        public static SavedPosParameters FromPosParameters(PosParameters pos)
        {
            var posParams = new SavedPosParameters
            {
                HashProof       = pos.HashProof.ToString(),
                Mint            = pos.Mint,
                Flags           = (int)pos.Flags,
                StakeModifier   = pos.StakeModifier,
                StakeModifierV2 = pos.StakeModifierV2.ToString(),
                StakeTime       = pos.StakeTime,
                PrevoutStake    = SavedOutPoint.FromOutPoint(pos.PrevoutStake)
            };

            return(posParams);
        }
Esempio n. 2
0
        public static SavedBlockHeader FromBlockHeader(BlockHeader header)
        {
            var savedHeader = new SavedBlockHeader
            {
                Bits           = header.Bits.Difficulty,
                BlockTime      = header.BlockTime.ToUnixTimeSeconds(),
                Time           = header.Time,
                Nonce          = header.Nonce,
                Version        = header.Version,
                HashMerkleRoot = header.HashMerkleRoot.ToString(),
                HashPrevBlock  = header.HashPrevBlock.ToString(),
                PosParameters  = SavedPosParameters.FromPosParameters(header.PosParameters)
            };

            return(savedHeader);
        }