Issue
allow_self_payment cannot be forwarded on the partial-payment (MPP) path, so partial self-payments fail.
Background
Nutshell can pay Lightning invoices in full or as a partial (MPP) shard.
Full payments use SendPaymentV2, which supports LND's allow_self_payment flag (added in #1092, merged as #1107). Partial payments, however, use a manual routing flow: pay_partial_invoice builds the MPP record by hand and dispatches it with QueryRoutes + SendToRouteV2 (cashu/lightning/lnd_grpc/lnd_grpc.py:231-308) or the REST equivalents (cashu/lightning/lndrest.py:283-351).
SendPaymentV2 cannot be used with a payment request to send a single partial shard (it drives the payment to completion), and it has no field to set the MPP record's total_amt_msat, which is why the manual path exists.
Problem
The manual path cannot honor MINT_LND_ALLOW_SELF_PAYMENT because LND's request messages do not expose the flag:
QueryRoutesRequest — no allow_self_payment (cashu/lightning/lnd_grpc/protos/lightning.proto:2971)
SendToRouteRequest — no allow_self_payment (cashu/lightning/lnd_grpc/protos/lightning.proto:900 and router.proto:421)
As a result, Nutshell cannot permit circular (self-)routing on the partial path, and partial self-payments fail in practice (typically with target not found / no route errors). The outcome is LND-version-dependent: QueryRoutes can produce self -> peer -> self routes in some versions (see lightningnetwork/lnd#7419, #10873), so the behavior is not reliably deterministic.
Impact on Nutshell
MINT_LND_ALLOW_SELF_PAYMENT is only honored on the full-payment path. A mint with the setting enabled can pay its own invoices in full, but any partial melt of a self-issued invoice fails.
Proposed Solution
Long-term (LND upstream): Add allow_self_payment to both QueryRoutesRequest and SendToRouteRequest so the manual path works unchanged. This cannot ship in Nutshell until the bundled protos match a supporting LND server.
Issue
allow_self_paymentcannot be forwarded on the partial-payment (MPP) path, so partial self-payments fail.Background
Nutshell can pay Lightning invoices in full or as a partial (MPP) shard.
Full payments use
SendPaymentV2, which supports LND'sallow_self_paymentflag (added in #1092, merged as #1107). Partial payments, however, use a manual routing flow:pay_partial_invoicebuilds the MPP record by hand and dispatches it withQueryRoutes+SendToRouteV2(cashu/lightning/lnd_grpc/lnd_grpc.py:231-308) or the REST equivalents (cashu/lightning/lndrest.py:283-351).SendPaymentV2cannot be used with a payment request to send a single partial shard (it drives the payment to completion), and it has no field to set the MPP record'stotal_amt_msat, which is why the manual path exists.Problem
The manual path cannot honor
MINT_LND_ALLOW_SELF_PAYMENTbecause LND's request messages do not expose the flag:QueryRoutesRequest— noallow_self_payment(cashu/lightning/lnd_grpc/protos/lightning.proto:2971)SendToRouteRequest— noallow_self_payment(cashu/lightning/lnd_grpc/protos/lightning.proto:900androuter.proto:421)As a result, Nutshell cannot permit circular (self-)routing on the partial path, and partial self-payments fail in practice (typically with
target not found/no routeerrors). The outcome is LND-version-dependent:QueryRoutescan produce self -> peer -> self routes in some versions (seelightningnetwork/lnd#7419,#10873), so the behavior is not reliably deterministic.Impact on Nutshell
MINT_LND_ALLOW_SELF_PAYMENTis only honored on the full-payment path. A mint with the setting enabled can pay its own invoices in full, but any partial melt of a self-issued invoice fails.Proposed Solution
Long-term (LND upstream): Add
allow_self_paymentto bothQueryRoutesRequestandSendToRouteRequestso the manual path works unchanged. This cannot ship in Nutshell until the bundled protos match a supporting LND server.