routerrpc: limit max parts if the invoice doesn't declare MPP support

This commit is contained in:
Juan Pablo Civile 2021-01-15 14:56:16 -03:00
parent ff897db293
commit fdd24fc1d6

@ -648,6 +648,10 @@ func (r *RouterBackend) extractIntentFromSendRequest(
payIntent.Amount = *payReq.MilliSat
}
if !payReq.Features.HasFeature(lnwire.MPPOptional) {
payIntent.MaxParts = 1
}
copy(payIntent.PaymentHash[:], payReq.PaymentHash[:])
destKey := payReq.Destination.SerializeCompressed()
copy(payIntent.Target[:], destKey)