btcjson/chainsvrresults: use int64 for verbose getblock[header] confs

This commit modifies the parsed fields in GetBlockVerbose
and GetBlockHeaderVerbose from a uint64 to an int64.
bitcoind will return -1 if the requested block is not in
the main chain, which causes a panic when trying to
serialize into a uint.
This commit is contained in:
Conner Fromknecht 2018-08-15 21:02:33 -07:00
parent f899737d7f
commit f696d49c49
No known key found for this signature in database
GPG key ID: E7D737B67FA592C7

View file

@ -11,7 +11,7 @@ import "encoding/json"
// returns a hex-encoded string.
type GetBlockHeaderVerboseResult struct {
Hash string `json:"hash"`
Confirmations uint64 `json:"confirmations"`
Confirmations int64 `json:"confirmations"`
Height int32 `json:"height"`
Version int32 `json:"version"`
VersionHex string `json:"versionHex"`
@ -29,7 +29,7 @@ type GetBlockHeaderVerboseResult struct {
// hex-encoded string.
type GetBlockVerboseResult struct {
Hash string `json:"hash"`
Confirmations uint64 `json:"confirmations"`
Confirmations int64 `json:"confirmations"`
StrippedSize int32 `json:"strippedsize"`
Size int32 `json:"size"`
Weight int32 `json:"weight"`