public static bool EnsureLowS(BlockSignature blockSignature) { var signature = new ECDSASignature(blockSignature.Signature); if (!signature.IsLowS) { blockSignature.Signature = signature.MakeCanonical().ToDER(); } return(true); }
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; }
protected bool Equals(BlockSignature other) { return(Equals(signature, other.signature)); }