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:
parent
f899737d7f
commit
f696d49c49
1 changed files with 2 additions and 2 deletions
|
@ -11,7 +11,7 @@ import "encoding/json"
|
||||||
// returns a hex-encoded string.
|
// returns a hex-encoded string.
|
||||||
type GetBlockHeaderVerboseResult struct {
|
type GetBlockHeaderVerboseResult struct {
|
||||||
Hash string `json:"hash"`
|
Hash string `json:"hash"`
|
||||||
Confirmations uint64 `json:"confirmations"`
|
Confirmations int64 `json:"confirmations"`
|
||||||
Height int32 `json:"height"`
|
Height int32 `json:"height"`
|
||||||
Version int32 `json:"version"`
|
Version int32 `json:"version"`
|
||||||
VersionHex string `json:"versionHex"`
|
VersionHex string `json:"versionHex"`
|
||||||
|
@ -29,7 +29,7 @@ type GetBlockHeaderVerboseResult struct {
|
||||||
// hex-encoded string.
|
// hex-encoded string.
|
||||||
type GetBlockVerboseResult struct {
|
type GetBlockVerboseResult struct {
|
||||||
Hash string `json:"hash"`
|
Hash string `json:"hash"`
|
||||||
Confirmations uint64 `json:"confirmations"`
|
Confirmations int64 `json:"confirmations"`
|
||||||
StrippedSize int32 `json:"strippedsize"`
|
StrippedSize int32 `json:"strippedsize"`
|
||||||
Size int32 `json:"size"`
|
Size int32 `json:"size"`
|
||||||
Weight int32 `json:"weight"`
|
Weight int32 `json:"weight"`
|
||||||
|
|
Loading…
Add table
Reference in a new issue