Skip to content

Commit 499d2df

Browse files
committed
routerrpc: reject payment to invoice that don't have payment secret or blinded paths
Ensure that a payment is only sent if the invoice includes either a payment address (payment secret) or at least one blinded path.
1 parent c9fe051 commit 499d2df

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

lnrpc/routerrpc/router_backend.go

+8
Original file line numberDiff line numberDiff line change
@@ -985,6 +985,14 @@ func (r *RouterBackend) extractIntentFromSendRequest(
985985
return nil, err
986986
}
987987

988+
// An invoice must include either a payment address or
989+
// blinded paths.
990+
if payReq.PaymentAddr.IsNone() &&
991+
len(payReq.BlindedPaymentPaths) == 0 {
992+
return nil, errors.New("payment request must contain " +
993+
"either a payment address or blinded paths")
994+
}
995+
988996
// If the amount was not included in the invoice, then we let
989997
// the payer specify the amount of satoshis they wish to send.
990998
// We override the amount to pay with the amount provided from

0 commit comments

Comments
 (0)