lnrpc/routerrpc+routing: add new MaxShardAmt field to LightningPayment

This commit is contained in:
Olaoluwa Osuntokun
2021-02-11 18:01:21 -08:00
parent c70e53c791
commit 7398e59927
2 changed files with 16 additions and 0 deletions

View File

@@ -572,6 +572,14 @@ func (r *RouterBackend) extractIntentFromSendRequest(
}
payIntent.MaxParts = maxParts
// If this payment had a max shard amount specified, then we'll apply
// that now, which'll force us to always make payment splits smaller
// than this.
if rpcPayReq.MaxShardSizeMsat > 0 {
shardAmtMsat := lnwire.MilliSatoshi(rpcPayReq.MaxShardSizeMsat)
payIntent.MaxShardAmt = &shardAmtMsat
}
// Take fee limit from request.
payIntent.FeeLimit, err = lnrpc.UnmarshallAmt(
rpcPayReq.FeeLimitSat, rpcPayReq.FeeLimitMsat,