Skip to content

Commit

Permalink
Add support for AMP and zero amount invoices
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasbarrett authored and Thomas Barrett committed Aug 5, 2022
1 parent 62ea2bd commit e181bf4
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
PKG := github.com/lightninglabs/lndclient
PKG := github.com/thomasbarrett/lndclient

LINT_PKG := github.com/golangci/golangci-lint/cmd/golangci-lint

Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module github.com/lightninglabs/lndclient
module github.com/thomasbarrett/lndclient

require (
github.com/btcsuite/btcd v0.22.0-beta.0.20211005184431-e3449998be39
Expand Down
1 change: 1 addition & 0 deletions lightning_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -1390,6 +1390,7 @@ func (s *lightningClient) AddInvoice(ctx context.Context,
Expiry: in.Expiry,
CltvExpiry: in.CltvExpiry,
Private: true,
IsAmp: in.Amp,
}

if in.Preimage != nil {
Expand Down
2 changes: 1 addition & 1 deletion macaroon_recipes_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import (
"io/ioutil"
"testing"

"github.com/lightninglabs/lndclient"
"github.com/stretchr/testify/require"
"github.com/thomasbarrett/lndclient"
)

var (
Expand Down
2 changes: 1 addition & 1 deletion router_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -379,6 +379,7 @@ func (r *routerClient) SendPayment(ctx context.Context,
MaxParts: request.MaxParts,
OutgoingChanIds: request.OutgoingChanIds,
AllowSelfPayment: request.AllowSelfPayment,
Amt: int64(request.Amount),
}
if request.MaxCltv != nil {
rpcReq.CltvLimit = *request.MaxCltv
Expand Down Expand Up @@ -415,7 +416,6 @@ func (r *routerClient) SendPayment(ctx context.Context,
// payment parameters.
if request.Invoice == "" {
rpcReq.Dest = request.Target[:]
rpcReq.Amt = int64(request.Amount)
rpcReq.PaymentHash = request.PaymentHash[:]
rpcReq.FinalCltvDelta = int32(request.FinalCLTVDelta)

Expand Down

0 comments on commit e181bf4

Please sign in to comment.