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()); }
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()); }
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()); }
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()); }