public virtual ProvenBlockHeader CreateProvenBlockHeader(PosBlock block) { var provenBlockHeader = new ProvenBlockHeader(block); // Serialize the size. provenBlockHeader.ToBytes(this); return(provenBlockHeader); }
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; }
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; }
public ProvenBlockHeader CreateProvenBlockHeader(PosBlock block) { return(new ProvenBlockHeader(block)); }