lncli: add listchaintxns command

This commit is contained in:
Thomas Preindl 2017-03-04 09:23:04 +01:00 committed by Olaoluwa Osuntokun
parent e1354dca45
commit 9665bb7e54
2 changed files with 23 additions and 0 deletions

@ -1491,3 +1491,25 @@ func decodePayReq(ctx *cli.Context) error {
printRespJson(resp) printRespJson(resp)
return nil return nil
} }
var ListChainTxns = cli.Command{
Name: "listchaintxns",
Usage: "List transactions from the wallet.",
Description: "List all transactions an address of the wallet was involved in.",
Action: listChainTxns,
}
func listChainTxns(ctx *cli.Context) error {
ctxb := context.Background()
client, cleanUp := getClient(ctx)
defer cleanUp()
resp, err := client.GetTransactions(ctxb, &lnrpc.GetTransactionsRequest{})
if err != nil {
return err
}
printRespJson(resp)
return nil
}

@ -77,6 +77,7 @@ func main() {
GetNetworkInfoCommand, GetNetworkInfoCommand,
DebugLevel, DebugLevel,
DecodePayReq, DecodePayReq,
ListChainTxns,
} }
if err := app.Run(os.Args); err != nil { if err := app.Run(os.Args); err != nil {