BitSharper.Block.GetWork C# (CSharp) 메소드

GetWork() 공개 메소드

Returns the work represented by this block.
Work is defined as the number of tries needed to solve a block in the average case. Consider a difficulty target that covers 5% of all possible hash values. Then the work of the block will be 20. As the target gets lower, the amount of work goes up.
public GetWork ( ) : BigInteger
리턴 Org.BouncyCastle.Math.BigInteger
        public BigInteger GetWork()
        {
            var target = GetDifficultyTargetAsInteger();
            return _largestHash.Divide(target.Add(BigInteger.One));
        }

Usage Example

예제 #1
0
        /// <summary>
        /// Creates a new StoredBlock, calculating the additional fields by adding to the values in this block.
        /// </summary>
        /// <exception cref="VerificationException"/>
        public StoredBlock Build(Block block)
        {
            // Stored blocks track total work done in this chain, because the canonical chain is the one that represents
            // the largest amount of work done not the tallest.
            var chainWork = _chainWork.Add(block.GetWork());
            var height    = _height + 1;

            return(new StoredBlock(block.CloneAsHeader(), chainWork, height));
        }
All Usage Examples Of BitSharper.Block::GetWork