mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-01-19 05:45:21 +01:00
lnd: unify the default setting behaviour.
Setting default values for the channel opening fee rate is already done elsewhere therefore we remove on of those checks and return an error if no fee rate is specified.
This commit is contained in:
parent
d0a7765c68
commit
bf38aed87f
17
server.go
17
server.go
@ -4578,16 +4578,15 @@ func (s *server) OpenChannel(
|
||||
return req.Updates, req.Err
|
||||
}
|
||||
|
||||
// If the fee rate wasn't specified, then we'll use a default
|
||||
// confirmation target.
|
||||
// If the fee rate wasn't specified at this point we fail the funding
|
||||
// because of the missing fee rate information. The caller of the
|
||||
// `OpenChannel` method needs to make sure that default values for the
|
||||
// fee rate are set beforehand.
|
||||
if req.FundingFeePerKw == 0 {
|
||||
estimator := s.cc.FeeEstimator
|
||||
feeRate, err := estimator.EstimateFeePerKW(6)
|
||||
if err != nil {
|
||||
req.Err <- err
|
||||
return req.Updates, req.Err
|
||||
}
|
||||
req.FundingFeePerKw = feeRate
|
||||
req.Err <- fmt.Errorf("no FundingFeePerKw specified for " +
|
||||
"the channel opening transaction")
|
||||
|
||||
return req.Updates, req.Err
|
||||
}
|
||||
|
||||
// Spawn a goroutine to send the funding workflow request to the funding
|
||||
|
Loading…
Reference in New Issue
Block a user