Ejemplo n.º 1
0
        public bool CheckProofOfWork(Consensus consensus)
        {
            BigInteger bits = this.Bits.ToBigInteger();

            if ((bits.CompareTo(BigInteger.Zero) <= 0) || (bits.CompareTo(Pow256) >= 0))
            {
                return(false);
            }

            return(consensus.GetPoWHash(consensus.NetworkOptions, this) <= this.Bits.ToUInt256());
        }
Ejemplo n.º 2
0
        public bool CheckProofOfWork(Consensus consensus)
        {
            consensus = consensus ?? Consensus.Main;
            var bits = Bits.ToBigInteger();

            if (bits.CompareTo(BigInteger.Zero) <= 0 || bits.CompareTo(Pow256) >= 0)
            {
                return(false);
            }
            // Check proof of work matches claimed amount
            return(consensus.GetPoWHash(this) <= Bits.ToUInt256());
        }
Ejemplo n.º 3
0
        public bool CheckProofOfWork(Consensus consensus)
        {
            consensus = consensus ?? Consensus.Main;
            var bits = Bits.ToBigInteger();

            if (bits.CompareTo(BigInteger.Zero) <= 0 || bits.CompareTo(Pow256) >= 0)
            {
                return(false);
            }
            // Check proof of work matches claimed amount
            if (Block.BlockSignature)             // note this can only be called on a POW block
            {
                return(GetPoWHash() <= Bits.ToUInt256());
            }
            return(consensus.GetPoWHash(this) <= Bits.ToUInt256());
        }
Ejemplo n.º 4
0
        public bool CheckProofOfWork(Consensus consensus)
        {
            consensus = consensus ?? Network.Main.Consensus;
            BigInteger bits = this.Bits.ToBigInteger();

            if ((bits.CompareTo(BigInteger.Zero) <= 0) || (bits.CompareTo(Pow256) >= 0))
            {
                return(false);
            }

            // Check proof of work matches claimed amount.
            if (Block.BlockSignature) // Note this can only be called on a POW block.
            {
                return(this.GetPoWHash() <= this.Bits.ToUInt256());
            }

            return(consensus.GetPoWHash(this) <= this.Bits.ToUInt256());
        }