Skip to content

Commit bb59d52

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 bb59d52

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

docs/release-notes/release-notes-0.20.0.md

+4
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@
6363
# Technical and Architectural Updates
6464
## BOLT Spec Updates
6565

66+
* [Required invoices to include a payment address or blinded paths](https://github.com/lightningnetwork/lnd/pull/9752) to comply with updated BOLT specifications before accepting payments.
67+
6668
## Testing
6769

6870
## Database
@@ -72,3 +74,5 @@
7274
## Tooling and Documentation
7375

7476
# Contributors (Alphabetical Order)
77+
78+
Erick Cestari

lnrpc/routerrpc/router_backend.go

+7
Original file line numberDiff line numberDiff line change
@@ -985,6 +985,13 @@ 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() && len(payReq.BlindedPaymentPaths) == 0 {
991+
return nil, errors.New("payment request must contain " +
992+
"either a payment address or blinded paths")
993+
}
994+
988995
// If the amount was not included in the invoice, then we let
989996
// the payer specify the amount of satoshis they wish to send.
990997
// We override the amount to pay with the amount provided from

0 commit comments

Comments
 (0)