diff --git a/rpcserver.go b/rpcserver.go index 424d16bd4..ecd98ec62 100644 --- a/rpcserver.go +++ b/rpcserver.go @@ -1922,12 +1922,21 @@ func (r *rpcServer) parseOpenChannelReq(in *lnrpc.OpenChannelRequest, // satoshis) does not exceed the amount the local party has requested // for funding. // - // TODO(roasbeef): incorporate base fee? if remoteInitialBalance >= localFundingAmt { return nil, fmt.Errorf("amount pushed to remote peer for " + "initial state must be below the local funding amount") } + // Determine if the user provided channel fees + // and if so pass them on to the funding workflow. + var channelBaseFee, channelFeeRate *uint64 + if in.UseBaseFee { + channelBaseFee = &in.BaseFee + } + if in.UseFeeRate { + channelFeeRate = &in.FeeRate + } + // Ensure that the user doesn't exceed the current soft-limit for // channel size. If the funding amount is above the soft-limit, then // we'll reject the request. @@ -2086,6 +2095,8 @@ func (r *rpcServer) parseOpenChannelReq(in *lnrpc.OpenChannelRequest, TargetPubkey: nodePubKey, ChainHash: *r.cfg.ActiveNetParams.GenesisHash, LocalFundingAmt: localFundingAmt, + BaseFee: channelBaseFee, + FeeRate: channelFeeRate, PushAmt: lnwire.NewMSatFromSatoshis(remoteInitialBalance), MinHtlcIn: minHtlcIn, FundingFeePerKw: feeRate,