Skip to content

Commit a31fa12

Browse files
committed
Use number for BestShare for AntMiner S19
1 parent 31712b5 commit a31fa12

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

number.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package cgminer
22

33
import (
44
"fmt"
5+
"math"
56
"strconv"
67
)
78

@@ -27,12 +28,12 @@ func (n Number) Float64() float64 {
2728

2829
// Int64 returns the number as an int64.
2930
func (n Number) Int64() int64 {
30-
return int64(n)
31+
return int64(n.Int())
3132
}
3233

3334
// Int returns the number as an int.
3435
func (n Number) Int() int {
35-
return int(n)
36+
return int(math.Round(float64(n)))
3637
}
3738

3839
func (n *Number) UnmarshalJSON(b []byte) error {

types.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -736,7 +736,7 @@ type Devs struct {
736736
// Pool - get working pools
737737
type Pool struct {
738738
Accepted int64
739-
BestShare int64 `json:"Best Share"`
739+
BestShare Number `json:"Best Share"`
740740
Diff1Shares int64 `json:"Diff1 Shares"`
741741
DifficultyAccepted float64 `json:"Difficulty Accepted"`
742742
DifficultyRejected float64 `json:"Difficulty Rejected"`

0 commit comments

Comments
 (0)