Skip to content

Commit

Permalink
use InitLNClient instead of NewLNDclient + GetAllPendingPayments into…
Browse files Browse the repository at this point in the history
… CheckPendingOutgoingPayments
  • Loading branch information
frnandu committed Feb 21, 2024
1 parent adf8cde commit 6de0c66
Showing 1 changed file with 13 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,13 @@ func main() {
// New Echo app
e := echo.New()

// Init new LND client
lndClient, err := lnd.NewLNDclient(lnd.LNDoptions{
Address: c.LNDAddress,
MacaroonFile: c.LNDMacaroonFile,
MacaroonHex: c.LNDMacaroonHex,
CertFile: c.LNDCertFile,
CertHex: c.LNDCertHex,
}, startupCtx)
//// Init new LND client
lnCfg, err := lnd.LoadConfig()
if err != nil {
logger.Fatalf("Error loading LN config: %v", err)
}
lndClient, err := lnd.InitLNClient(lnCfg, logger, startupCtx)

if err != nil {
e.Logger.Fatalf("Error initializing the LND connection: %v", err)
}
Expand All @@ -67,7 +66,12 @@ func main() {
InvoicePubSub: service.NewPubsub(),
}

err = svc.CheckAllPendingOutgoingPayments(startupCtx)
pendingPayments, err := svc.GetAllPendingPayments(startupCtx)
if err != nil {
return
}

err = svc.CheckPendingOutgoingPayments(startupCtx, pendingPayments)
if err != nil {
sentry.CaptureException(err)
svc.Logger.Error(err)
Expand Down

0 comments on commit 6de0c66

Please sign in to comment.