BitSharp.Core.Domain.BlockHeader.Create C# (CSharp) Method

Create() public static method

public static Create ( UInt32 version, UInt256 previousBlock, UInt256 merkleRoot, DateTimeOffset time, UInt32 bits, UInt32 nonce ) : BlockHeader
version System.UInt32
previousBlock UInt256
merkleRoot UInt256
time DateTimeOffset
bits System.UInt32
nonce System.UInt32
return BlockHeader
        public static BlockHeader Create(UInt32 version, UInt256 previousBlock, UInt256 merkleRoot, DateTimeOffset time, UInt32 bits, UInt32 nonce)
        {
            var hash = DataCalculator.CalculateBlockHash(version, previousBlock, merkleRoot, time, bits, nonce);
            return new BlockHeader(version, previousBlock, merkleRoot, time, bits, nonce, hash);
        }
    }

Usage Example

Example #1
0
 public BlockHeader With(UInt32?Version = null, UInt256 PreviousBlock = null, UInt256 MerkleRoot = null, DateTimeOffset?Time = null, UInt32?Bits = null, UInt32?Nonce = null)
 {
     return(BlockHeader.Create
            (
                Version ?? this.Version,
                PreviousBlock ?? this.PreviousBlock,
                MerkleRoot ?? this.MerkleRoot,
                Time ?? this.Time,
                Bits ?? this.Bits,
                Nonce ?? this.Nonce
            ));
 }