Merge pull request #4924 from champo/check_payreq_multipart

routerrpc,routing: limit max parts if the invoice doesn't declare MPP support
This commit is contained in:
Olaoluwa Osuntokun
2021-02-03 16:53:49 -08:00
committed by GitHub
2 changed files with 10 additions and 0 deletions

View File

@@ -278,6 +278,12 @@ func (p *paymentSession) RequestRoute(maxAmt, feeLimit lnwire.MilliSatoshi,
return nil, errNoPathFound
}
if !p.payment.DestFeatures.HasFeature(lnwire.MPPOptional) {
p.log.Debug("not splitting because destination doesn't declare MPP")
return nil, errNoPathFound
}
// No splitting if this is the last shard.
isLastShard := activeShards+1 >= p.payment.MaxParts
if isLastShard {