mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-02-22 14:22:37 +01:00
rpcserver: parse channel fees into InitFundingMsg
This commit is contained in:
parent
e87412bd63
commit
1e030c2d48
1 changed files with 12 additions and 1 deletions
13
rpcserver.go
13
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,
|
||||
|
|
Loading…
Add table
Reference in a new issue