multi: send MPP payment to blinded path

Make various sender side adjustments so that a sender is able to send an
MP payment to a single blinded path without actually including an MPP
record in the payment.
This commit is contained in:
Elle Mouton
2024-05-07 12:24:55 +02:00
parent 64a99d4a8e
commit f0558babf3
4 changed files with 238 additions and 8 deletions

View File

@ -338,8 +338,12 @@ func (p *paymentSession) RequestRoute(maxAmt, feeLimit lnwire.MilliSatoshi,
switch {
case err == errNoPathFound:
// Don't split if this is a legacy payment without mpp
// record.
if p.payment.PaymentAddr == nil {
// record. If it has a blinded path though, then we
// can split. Split payments to blinded paths won't have
// MPP records.
if p.payment.PaymentAddr == nil &&
p.payment.BlindedPayment == nil {
p.log.Debugf("not splitting because payment " +
"address is unspecified")
@ -357,7 +361,8 @@ func (p *paymentSession) RequestRoute(maxAmt, feeLimit lnwire.MilliSatoshi,
!destFeatures.HasFeature(lnwire.AMPOptional) {
p.log.Debug("not splitting because " +
"destination doesn't declare MPP or AMP")
"destination doesn't declare MPP or " +
"AMP")
return nil, errNoPathFound
}