rpcserver: Increase getblock difficulty prec to 8.
This commit increases the precision of the difficulty field of the getblock RPC to 8 to match Bitcoin Core. Closes #414.
This commit is contained in:
parent
005b540895
commit
2dfb4be707
1 changed files with 1 additions and 1 deletions
|
@ -911,7 +911,7 @@ func getDifficultyRatio(bits uint32) float64 {
|
|||
target := blockchain.CompactToBig(bits)
|
||||
|
||||
difficulty := new(big.Rat).SetFrac(max, target)
|
||||
outString := difficulty.FloatString(2)
|
||||
outString := difficulty.FloatString(8)
|
||||
diff, err := strconv.ParseFloat(outString, 64)
|
||||
if err != nil {
|
||||
rpcsLog.Errorf("Cannot get difficulty: %v", err)
|
||||
|
|
Loading…
Add table
Reference in a new issue