예제 #1
0
        public virtual ProvenBlockHeader CreateProvenBlockHeader(PosBlock block)
        {
            var provenBlockHeader = new ProvenBlockHeader(block);

            // Serialize the size.
            provenBlockHeader.ToBytes(this);

            return(provenBlockHeader);
        }
예제 #2
0
        public ProvenBlockHeader(PosBlock block)
        {
            if (block == null)
            {
                throw new ArgumentNullException(nameof(block));
            }

            // Copy block header properties.
            this.CopyFields(block.Header);

            this.signature   = block.BlockSignature;
            this.coinstake   = block.GetProtocolTransaction();
            this.merkleProof = new MerkleBlock(block, new[] { this.coinstake.GetHash() }).PartialMerkleTree;
        }
예제 #3
0
        public ProvenBlockHeader(PosBlock block)
        {
            if (block == null)
            {
                throw new ArgumentNullException(nameof(block));
            }

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

            this.signature   = block.BlockSignature;
            this.coinstake   = block.Transactions[1];
            this.merkleProof = new MerkleBlock(block, new[] { this.coinstake.GetHash() }).PartialMerkleTree;
        }
예제 #4
0
 public ProvenBlockHeader CreateProvenBlockHeader(PosBlock block)
 {
     return(new ProvenBlockHeader(block));
 }