From 3d76571621d9f34d7c0470b7d621aea916ceb0f6 Mon Sep 17 00:00:00 2001 From: David Hill Date: Fri, 29 Aug 2014 09:14:20 -0400 Subject: [PATCH] Update getnetworkinfo structure. This matches the changes in Bitcoin Core. Tested with btcctl. OK @jcvernaleo --- jsonresults.go | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/jsonresults.go b/jsonresults.go index 452164cc..9474b68a 100644 --- a/jsonresults.go +++ b/jsonresults.go @@ -131,7 +131,7 @@ type GetNetworkInfoResult struct { ProtocolVersion int32 `json:"protocolversion"` TimeOffset int64 `json:"timeoffset"` Connections int32 `json:"connections"` - Proxy string `json:"proxy,omitempty"` + Networks []NetworksResult `json:"networks"` RelayFee float64 `json:"relayfee"` LocalAddresses []LocalAddressesResult `json:"localaddresses"` } @@ -382,6 +382,14 @@ type ListUnspentResult struct { Confirmations int64 `json:"confirmations"` } +// NetworksResult models the networks data from the getnetworkinfo command. +type NetworksResult struct { + Name string `json:"name"` + Limited bool `json:"limited"` + Reachable bool `json:"reachable"` + Proxy string `json:"proxy"` +} + // SignRawTransactionResult models the data from the signrawtransaction // command. type SignRawTransactionResult struct {