Add support for GetNetTotalsResult.

ok @jcvernaleo
This commit is contained in:
Dave Collins 2014-02-05 09:40:56 -06:00
parent 0d1539118b
commit 4661be8758

View file

@ -97,6 +97,13 @@ type TxRawDecodeResult struct {
Vout []Vout `json:"vout"` 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 // ScriptSig models a signature script. It is defined seperately since it only
// applies to non-coinbase. Therefore the field in the Vin structure needs // applies to non-coinbase. Therefore the field in the Vin structure needs
// to be a pointer. // to be a pointer.
@ -878,6 +885,12 @@ func ReadResultCmd(cmd string, message []byte) (Reply, error) {
result.Result = res result.Result = res
} }
} }
case "getnettotals":
var res GetNetTotalsResult
err = json.Unmarshal(objmap["result"], &res)
if err == nil {
result.Result = res
}
case "getrawtransaction": case "getrawtransaction":
// getrawtransaction can either return a JSON object or a // getrawtransaction can either return a JSON object or a
// hex-encoded string depending on the verbose flag. Choose the // hex-encoded string depending on the verbose flag. Choose the