cmd/lncli: update ad-hoc addinvoice response json to display add_index

This commit is contained in:
Olaoluwa Osuntokun 2018-07-05 22:05:23 -05:00
parent 43d1d1f4f2
commit 4813da9a64
No known key found for this signature in database
GPG Key ID: 964EA263DD637C21

@ -1585,33 +1585,33 @@ var closedChannelsCommand = cli.Command{
Name: "closedchannels", Name: "closedchannels",
Category: "Channels", Category: "Channels",
Usage: "List all closed channels.", Usage: "List all closed channels.",
Flags: []cli.Flag{ Flags: []cli.Flag{
cli.BoolFlag{ cli.BoolFlag{
Name: "cooperative", Name: "cooperative",
Usage: "list channels that were closed cooperatively", Usage: "list channels that were closed cooperatively",
}, },
cli.BoolFlag{ cli.BoolFlag{
Name: "local_force", Name: "local_force",
Usage: "list channels that were force-closed " + Usage: "list channels that were force-closed " +
"by the local node", "by the local node",
}, },
cli.BoolFlag{ cli.BoolFlag{
Name: "remote_force", Name: "remote_force",
Usage: "list channels that were force-closed " + Usage: "list channels that were force-closed " +
"by the remote node", "by the remote node",
}, },
cli.BoolFlag{ cli.BoolFlag{
Name: "breach", Name: "breach",
Usage: "list channels for which the remote node " + Usage: "list channels for which the remote node " +
"attempted to broadcast a prior " + "attempted to broadcast a prior " +
"revoked channel state", "revoked channel state",
}, },
cli.BoolFlag{ cli.BoolFlag{
Name: "funding_canceled", Name: "funding_canceled",
Usage: "list channels that were never fully opened", Usage: "list channels that were never fully opened",
}, },
}, },
Action: actionDecorator(closedChannels), Action: actionDecorator(closedChannels),
} }
func closedChannels(ctx *cli.Context) error { func closedChannels(ctx *cli.Context) error {
@ -1624,7 +1624,7 @@ func closedChannels(ctx *cli.Context) error {
LocalForce: ctx.Bool("local_force"), LocalForce: ctx.Bool("local_force"),
RemoteForce: ctx.Bool("remote_force"), RemoteForce: ctx.Bool("remote_force"),
Breach: ctx.Bool("breach"), Breach: ctx.Bool("breach"),
FundingCanceled: ctx.Bool("funding_cancelled"), FundingCanceled: ctx.Bool("funding_cancelled"),
} }
resp, err := client.ClosedChannels(ctxb, req) resp, err := client.ClosedChannels(ctxb, req)
@ -2192,11 +2192,13 @@ func addInvoice(ctx *cli.Context) error {
} }
printJSON(struct { printJSON(struct {
RHash string `json:"r_hash"` RHash string `json:"r_hash"`
PayReq string `json:"pay_req"` PayReq string `json:"pay_req"`
AddIndex uint64 `json:"add_index"`
}{ }{
RHash: hex.EncodeToString(resp.RHash), RHash: hex.EncodeToString(resp.RHash),
PayReq: resp.PaymentRequest, PayReq: resp.PaymentRequest,
AddIndex: resp.AddIndex,
}) })
return nil return nil