track outgoing payments in goroutines

This commit is contained in:
kiwiidb
2022-11-29 13:34:54 +01:00
parent c437651cf8
commit 10278c7de3
6 changed files with 62 additions and 37 deletions

View File

@@ -4,6 +4,7 @@ import (
"context"
"github.com/lightningnetwork/lnd/lnrpc"
"github.com/lightningnetwork/lnd/lnrpc/routerrpc"
"google.golang.org/grpc"
)
@@ -12,11 +13,14 @@ type LightningClientWrapper interface {
SendPaymentSync(ctx context.Context, req *lnrpc.SendRequest, options ...grpc.CallOption) (*lnrpc.SendResponse, error)
AddInvoice(ctx context.Context, req *lnrpc.Invoice, options ...grpc.CallOption) (*lnrpc.AddInvoiceResponse, error)
SubscribeInvoices(ctx context.Context, req *lnrpc.InvoiceSubscription, options ...grpc.CallOption) (SubscribeInvoicesWrapper, error)
SubscribePayment(ctx context.Context, req *routerrpc.TrackPaymentRequest, options ...grpc.CallOption) (SubscribePaymentWrapper, error)
GetInfo(ctx context.Context, req *lnrpc.GetInfoRequest, options ...grpc.CallOption) (*lnrpc.GetInfoResponse, error)
DecodeBolt11(ctx context.Context, bolt11 string, options ...grpc.CallOption) (*lnrpc.PayReq, error)
TrackPayment(ctx context.Context, hash []byte, options ...grpc.CallOption) (*lnrpc.Payment, error)
}
type SubscribeInvoicesWrapper interface {
Recv() (*lnrpc.Invoice, error)
}
type SubscribePaymentWrapper interface {
Recv() (*lnrpc.Payment, error)
}