Merge pull request #2194 from xsb/num-inactive-chan-reorder

lnrpc: reorder num_inactive_channels
This commit is contained in:
Conner Fromknecht 2018-11-30 15:24:22 -08:00 committed by GitHub
commit 157d181a66
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -1585,7 +1585,39 @@ func getInfo(ctx *cli.Context) error {
return err
}
printRespJSON(resp)
// We print a struct that mimics the proto definition of GetInfoResponse
// but has a better ordering for the same list of fields.
printJSON(struct {
Version string `json:"version"`
IdentityPubkey string `json:"identity_pubkey"`
Alias string `json:"alias"`
NumPendingChannels uint32 `json:"num_pending_channels"`
NumActiveChannels uint32 `json:"num_active_channels"`
NumInactiveChannels uint32 `json:"num_inactive_channels"`
NumPeers uint32 `json:"num_peers"`
BlockHeight uint32 `json:"block_height"`
BlockHash string `json:"block_hash"`
BestHeaderTimestamp int64 `json:"best_header_timestamp"`
SyncedToChain bool `json:"synced_to_chain"`
Testnet bool `json:"testnet"`
Chains []string `json:"chains"`
Uris []string `json:"uris"`
}{
Version: resp.Version,
IdentityPubkey: resp.IdentityPubkey,
Alias: resp.Alias,
NumPendingChannels: resp.NumPendingChannels,
NumActiveChannels: resp.NumActiveChannels,
NumInactiveChannels: resp.NumInactiveChannels,
NumPeers: resp.NumPeers,
BlockHeight: resp.BlockHeight,
BlockHash: resp.BlockHash,
BestHeaderTimestamp: resp.BestHeaderTimestamp,
SyncedToChain: resp.SyncedToChain,
Testnet: resp.Testnet,
Chains: resp.Chains,
Uris: resp.Uris,
})
return nil
}