diff --git a/lnrpc/routerrpc/router_backend.go b/lnrpc/routerrpc/router_backend.go index 0756770d4..1e2b5ccd5 100644 --- a/lnrpc/routerrpc/router_backend.go +++ b/lnrpc/routerrpc/router_backend.go @@ -24,6 +24,15 @@ import ( "github.com/lightningnetwork/lnd/zpay32" ) +const ( + // DefaultMaxParts is the default number of splits we'll possibly use + // for MPP when the user is attempting to send a payment. + // + // TODO(roasbeef): make this value dynamic based on expected number of + // attempts for given amount + DefaultMaxParts = 16 +) + // RouterBackend contains the backend implementation of the router rpc sub // server calls. type RouterBackend struct { @@ -554,11 +563,12 @@ func (r *RouterBackend) extractIntentFromSendRequest( } payIntent.CltvLimit = cltvLimit - // Take max htlcs from the request. Map zero to one for backwards - // compatibility. + // Attempt to parse the max parts value set by the user, if this value + // isn't set, then we'll use the current default value for this + // setting. maxParts := rpcPayReq.MaxParts if maxParts == 0 { - maxParts = 1 + maxParts = DefaultMaxParts } payIntent.MaxParts = maxParts