Add support for GetNetTotalsResult.
ok @jcvernaleo
This commit is contained in:
parent
0d1539118b
commit
4661be8758
1 changed files with 13 additions and 0 deletions
13
jsonapi.go
13
jsonapi.go
|
@ -97,6 +97,13 @@ type TxRawDecodeResult struct {
|
|||
Vout []Vout `json:"vout"`
|
||||
}
|
||||
|
||||
// GetNetTotalsResult models the data returned from the getnettotals command.
|
||||
type GetNetTotalsResult struct {
|
||||
TotalBytesRecv uint64 `json:"totalbytesrecv"`
|
||||
TotalBytesSent uint64 `json:"totalbytessent"`
|
||||
TimeMillis int64 `json:"timemillis"`
|
||||
}
|
||||
|
||||
// ScriptSig models a signature script. It is defined seperately since it only
|
||||
// applies to non-coinbase. Therefore the field in the Vin structure needs
|
||||
// to be a pointer.
|
||||
|
@ -878,6 +885,12 @@ func ReadResultCmd(cmd string, message []byte) (Reply, error) {
|
|||
result.Result = res
|
||||
}
|
||||
}
|
||||
case "getnettotals":
|
||||
var res GetNetTotalsResult
|
||||
err = json.Unmarshal(objmap["result"], &res)
|
||||
if err == nil {
|
||||
result.Result = res
|
||||
}
|
||||
case "getrawtransaction":
|
||||
// getrawtransaction can either return a JSON object or a
|
||||
// hex-encoded string depending on the verbose flag. Choose the
|
||||
|
|
Loading…
Reference in a new issue