channeldb: save outgoing payments

Add structure for outgoing payments. Saving payment in DB
after successful payment send. Add RPC call for listing
all payments.
This commit is contained in:
BitfuryLightning authored and Olaoluwa Osuntokun committed 2016-12-27 16:16:23 -08:00
1 parent 343cd7779f
commit eb4d0e035e
12 files changed
+1117 -168

No files matched your search

+24
View File
@@ -1076,3 +1076,27 @@ func printRTAsJSON(r *rt.RoutingTable) {
}
printRespJson(channels)
}
var ListPaymentsCommand = cli.Command{
Name: "listpayments",
Usage: "listpayments",
Description: "list all outgoing payments",
Action: listPayments,
}
func listPayments(ctx *cli.Context) error {
client := getClient(ctx)
req := &lnrpc.ListPaymentsRequest{}
payments, err := client.ListPayments(context.Background(), req)
if err != nil {
return err
}
printRespJson(payments)
return nil
}
+1
View File
@@ -66,6 +66,7 @@ func main() {
ListInvoicesCommand,
ShowRoutingTableCommand,
ListChannelsCommand,
ListPaymentsCommand,
}
if err := app.Run(os.Args); err != nil {