示例#1
0
        public ProvenBlockHeader(PosBlock block, PosBlockHeader posBlockHeader)
        {
            if (block == null)
            {
                throw new ArgumentNullException(nameof(block));
            }

            // Copy block header properties.
            this.posBlockHeader = posBlockHeader;
            this.posBlockHeader.HashPrevBlock     = block.Header.HashPrevBlock;
            this.posBlockHeader.HashMerkleRoot    = block.Header.HashMerkleRoot;
            this.posBlockHeader.Time              = block.Header.Time;
            this.posBlockHeader.Bits              = block.Header.Bits;
            this.posBlockHeader.Nonce             = block.Header.Nonce;
            this.posBlockHeader.Version           = block.Header.Version;
            this.posBlockHeader.ProvenBlockHeader = this;

            this.signature   = block.BlockSignature;
            this.coinstake   = block.GetProtocolTransaction();
            this.merkleProof = new MerkleBlock(block, new[] { this.coinstake.GetHash() }).PartialMerkleTree;
        }
示例#2
0
 protected bool Equals(BlockSignature other)
 {
     return(Equals(this.signature, other.signature));
 }