Skip to content

Commit 69e180c

Browse files
committed
cmd/payments: reject invoices without 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. This enforces invoice security requirements and prevents insecure payment attempts.
1 parent c9fe051 commit 69e180c

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

cmd/commands/cmd_payments.go

+8
Original file line numberDiff line numberDiff line change
@@ -588,6 +588,14 @@ func SendPaymentRequest(ctx *cli.Context, req *routerrpc.SendPaymentRequest,
588588
amt = invoiceAmt
589589
}
590590

591+
// An invoice must include either a payment address or
592+
// blinded paths.
593+
if (len(decodeResp.PaymentAddr) == 0) &&
594+
decodeResp.BlindedPaths == nil {
595+
return fmt.Errorf("invoice must contain either a " +
596+
"payment address or blinded paths")
597+
}
598+
591599
// Calculate fee limit based on the determined amount.
592600
feeLimit, err = retrieveFeeLimit(ctx, amt)
593601
if err != nil {

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

0 commit comments

Comments
 (0)