Skip to content

Commit c7d431e

Browse files
committed
Add support for AMP and zero amount invoices
1 parent 62ea2bd commit c7d431e

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

lightning_client.go

+1
Original file line numberDiff line numberDiff line change
@@ -1390,6 +1390,7 @@ func (s *lightningClient) AddInvoice(ctx context.Context,
13901390
Expiry: in.Expiry,
13911391
CltvExpiry: in.CltvExpiry,
13921392
Private: true,
1393+
IsAmp: in.Amp,
13931394
}
13941395

13951396
if in.Preimage != nil {

router_client.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -379,6 +379,7 @@ func (r *routerClient) SendPayment(ctx context.Context,
379379
MaxParts: request.MaxParts,
380380
OutgoingChanIds: request.OutgoingChanIds,
381381
AllowSelfPayment: request.AllowSelfPayment,
382+
Amt: int64(request.Amount),
382383
}
383384
if request.MaxCltv != nil {
384385
rpcReq.CltvLimit = *request.MaxCltv
@@ -415,7 +416,6 @@ func (r *routerClient) SendPayment(ctx context.Context,
415416
// payment parameters.
416417
if request.Invoice == "" {
417418
rpcReq.Dest = request.Target[:]
418-
rpcReq.Amt = int64(request.Amount)
419419
rpcReq.PaymentHash = request.PaymentHash[:]
420420
rpcReq.FinalCltvDelta = int32(request.FinalCLTVDelta)
421421

0 commit comments

Comments
 (0)