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 committed Aug 3, 2022
1 parent 62ea2bd commit c7d431e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
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 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 c7d431e

Please sign in to comment.