Fix types.Difficulty Float64() off by one error

This commit is contained in:
DataHoarder 2024-04-07 04:10:46 +02:00
parent 44d969a218
commit 446929e7be
Signed by: DataHoarder
SSH key fingerprint: SHA256:OLTRf6Fl87G52SiR7sWLGNzlJt4WOX+tfI2yxo0z7xk

View file

@ -188,7 +188,7 @@ func (d Difficulty) Big() *big.Int {
}
func (d Difficulty) Float64() float64 {
return float64(d.Lo) + float64(d.Hi)*math.MaxUint64
return float64(d.Lo) + float64(d.Hi)*(float64(math.MaxUint64)+1)
}
func (d Difficulty) MarshalJSON() ([]byte, error) {