From d0a2506a968d8907b995c9a457147c214cdc7bed Mon Sep 17 00:00:00 2001 From: Dave Collins Date: Sat, 3 May 2014 12:19:40 -0500 Subject: [PATCH] Improve GetMiningInfoResult. This commit modifies the types of the GetMiningInfoResult to better match their underlying types. While the information was all available and accurate, it's nicer to treat numeric values as proper types instead of all float64s. Also, a new networkhashps field has been added for compatibility with the reference implementation. --- jsonresults.go | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/jsonresults.go b/jsonresults.go index 2bc6a45e..1e470f2a 100644 --- a/jsonresults.go +++ b/jsonresults.go @@ -237,16 +237,17 @@ type Vout struct { // GetMiningInfoResult models the data from the getmininginfo command. type GetMiningInfoResult struct { - CurrentBlockSize float64 `json:"currentblocksize"` + Blocks int64 `json:"blocks"` + CurrentBlockSize uint64 `json:"currentblocksize"` + CurrentBlockTx uint64 `json:"currentblocktx"` Difficulty float64 `json:"difficulty"` Errors string `json:"errors"` Generate bool `json:"generate"` - GenProcLimit float64 `json:"genproclimit"` - PooledTx float64 `json:"pooledtx"` + GenProcLimit int `json:"genproclimit"` + HashesPerSec int64 `json:"hashespersec"` + NetworkHashPS int64 `json:"networkhashps"` + PooledTx uint64 `json:"pooledtx"` Testnet bool `json:"testnet"` - Blocks float64 `json:"blocks"` - CurrentBlockTx float64 `json:"currentblocktx"` - HashesPerSec float64 `json:"hashespersec"` } // GetWorkResult models the data from the getwork command.