From e86965f6f977eb3b052236a0f425b5536b8357c0 Mon Sep 17 00:00:00 2001 From: Olaoluwa Osuntokun Date: Wed, 22 Jan 2020 16:52:06 -0800 Subject: [PATCH] challenger: modify to only use invoice macaroon --- challenger.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/challenger.go b/challenger.go index 5a7bfef..d96900c 100644 --- a/challenger.go +++ b/challenger.go @@ -25,6 +25,12 @@ type LndChallenger struct { // mint.Challenger interface. var _ mint.Challenger = (*LndChallenger)(nil) +const ( + // readOnlyMacaroonName is the name of the read-only macaroon belonging + // to the target lnd node. + readOnlyMacaroonName = "invoice.macaroon" +) + // NewLndChallenger creates a new challenger that uses the given connection // details to connect to an lnd backend to create payment challenges. func NewLndChallenger(cfg *authConfig, genInvoiceReq InvoiceRequestGenerator) ( @@ -36,6 +42,7 @@ func NewLndChallenger(cfg *authConfig, genInvoiceReq InvoiceRequestGenerator) ( client, err := lndclient.NewBasicClient( cfg.LndHost, cfg.TLSPath, cfg.MacDir, cfg.Network, + lndclient.MacFilename(readOnlyMacaroonName), ) if err != nil { return nil, err