mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-12-05 18:31:37 +01:00
invoicesrpc: fix route hint off-by-one-error
right now it is possible to add 21 route hints which results in an error.
This commit is contained in:
@@ -268,7 +268,7 @@ func AddInvoice(ctx context.Context, cfg *AddInvoiceConfig,
|
|||||||
for _, channel := range openChannels {
|
for _, channel := range openChannels {
|
||||||
// We'll restrict the number of individual route hints
|
// We'll restrict the number of individual route hints
|
||||||
// to 20 to avoid creating overly large invoices.
|
// to 20 to avoid creating overly large invoices.
|
||||||
if numHints > 20 {
|
if numHints >= 20 {
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user