Exemple #1
0
        public static bool EnsureLowS(BlockSignature blockSignature)
        {
            var signature = new ECDSASignature(blockSignature.Signature);

            if (!signature.IsLowS)
            {
                blockSignature.Signature = signature.MakeCanonical().ToDER();
            }
            return(true);
        }
Exemple #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;
        }
Exemple #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;
        }
Exemple #4
0
 protected bool Equals(BlockSignature other)
 {
     return(Equals(signature, other.signature));
 }