Skip to content

Commit

Permalink
Separate maxTarget variable
Browse files Browse the repository at this point in the history
  • Loading branch information
earlbread committed Apr 25, 2019
1 parent 7727fa0 commit 01dcf64
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Libplanet/HashDigest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -163,8 +163,8 @@ public bool LessThanTarget(long difficulty)
return true;
}

var target = new BigInteger(
Math.Pow(2, 256) / difficulty);
double maxTarget = Math.Pow(2, 256);
var target = new BigInteger(maxTarget / difficulty);

// Add zero to convert unsigned BigInteger
var result = new BigInteger(ByteArray.Add(0).ToArray());
Expand Down

0 comments on commit 01dcf64

Please sign in to comment.