rpc: allow outgoing wumbo channel requests if wumbo is enabled

This commit is contained in:
Olaoluwa Osuntokun 2020-07-01 21:05:43 -07:00
parent 8177fed302
commit 67b8bca5b2
No known key found for this signature in database
GPG Key ID: BC13F65E2DC84465

@ -1713,6 +1713,8 @@ func (r *rpcServer) parseOpenChannelReq(in *lnrpc.OpenChannelRequest,
remoteCsvDelay := uint16(in.RemoteCsvDelay) remoteCsvDelay := uint16(in.RemoteCsvDelay)
maxValue := lnwire.MilliSatoshi(in.RemoteMaxValueInFlightMsat) maxValue := lnwire.MilliSatoshi(in.RemoteMaxValueInFlightMsat)
globalFeatureSet := r.server.featureMgr.Get(feature.SetNodeAnn)
// Ensure that the initial balance of the remote party (if pushing // Ensure that the initial balance of the remote party (if pushing
// satoshis) does not exceed the amount the local party has requested // satoshis) does not exceed the amount the local party has requested
// for funding. // for funding.
@ -1726,7 +1728,10 @@ func (r *rpcServer) parseOpenChannelReq(in *lnrpc.OpenChannelRequest,
// Ensure that the user doesn't exceed the current soft-limit for // Ensure that the user doesn't exceed the current soft-limit for
// channel size. If the funding amount is above the soft-limit, then // channel size. If the funding amount is above the soft-limit, then
// we'll reject the request. // we'll reject the request.
if localFundingAmt > MaxFundingAmount { wumboEnabled := globalFeatureSet.HasFeature(
lnwire.WumboChannelsOptional,
)
if !wumboEnabled && localFundingAmt > MaxFundingAmount {
return nil, fmt.Errorf("funding amount is too large, the max "+ return nil, fmt.Errorf("funding amount is too large, the max "+
"channel size is: %v", MaxFundingAmount) "channel size is: %v", MaxFundingAmount)
} }