fix(lnd): enable MPP via max_parts=16 and time_pref in SendPaymentV2 (#3916)
What changed, and why it matters
This change adjusts how LNbits sends Lightning payments through LND by enabling multi-part payments (splitting a payment across up to 16 routes) and slightly favoring faster routes over cheaper ones. It is a functional/performance fix, not a security patch. There is no direct evidence in the commit that it fixes a vulnerability or that it was disclosed as a security issue.
No security action required. Treat as a normal functional improvement. If reviewing for operational risk, verify that max_parts=16 and time_pref=0.9 align with your node's fee and reliability policies.
Security signals we found
No security-relevant keywords in commit title or message
No input validation, authentication, authorization, or cryptographic changes
Change is limited to payment routing parameters (max_parts, time_pref)
No references to CVEs, advisories, researchers, or security reports
Evidence from the diff
The commit adds two fields to the LND SendPaymentV2 request in lnbits/wallets/lndgrpc.py: max_parts=16 and time_pref=0.9. max_parts enables Multi-Path Payments (MPP), allowing LND to split a payment into up to 16 sub-parts. time_pref=0.9 biases pathfinding toward lower time preference (faster delivery) versus lower cost. The change is purely additive and does not alter authentication, authorization, input validation, cryptography, or error handling. No security relevance is stated in the commit message or diff.
Changed components
lnbits/wallets/lndgrpc.pyLndWallet.pay_invoice() / SendPaymentV2 request constructionInspect captured patch +2 / −0
diff --git a/lnbits/wallets/lndgrpc.py b/lnbits/wallets/lndgrpc.py
index bef9415..ceaa44f 100644
--- a/lnbits/wallets/lndgrpc.py
+++ b/lnbits/wallets/lndgrpc.py
@@ -192,6 +192,8 @@ class LndWallet(Wallet):
fee_limit_msat=fee_limit_msat,
timeout_seconds=30,
no_inflight_updates=True,
+ max_parts=16,
+ time_pref=0.9,
)
try:
res: Payment = await self.router_rpc.SendPaymentV2(req).read()
Why this scored 19/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.