Skip to content

Commit bf38aed

Browse files
committed
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.
1 parent d0a7765 commit bf38aed

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

server.go

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4578,16 +4578,15 @@ func (s *server) OpenChannel(
45784578
return req.Updates, req.Err
45794579
}
45804580

4581-
// If the fee rate wasn't specified, then we'll use a default
4582-
// confirmation target.
4581+
// If the fee rate wasn't specified at this point we fail the funding
4582+
// because of the missing fee rate information. The caller of the
4583+
// `OpenChannel` method needs to make sure that default values for the
4584+
// fee rate are set beforehand.
45834585
if req.FundingFeePerKw == 0 {
4584-
estimator := s.cc.FeeEstimator
4585-
feeRate, err := estimator.EstimateFeePerKW(6)
4586-
if err != nil {
4587-
req.Err <- err
4588-
return req.Updates, req.Err
4589-
}
4590-
req.FundingFeePerKw = feeRate
4586+
req.Err <- fmt.Errorf("no FundingFeePerKw specified for " +
4587+
"the channel opening transaction")
4588+
4589+
return req.Updates, req.Err
45914590
}
45924591

45934592
// Spawn a goroutine to send the funding workflow request to the funding

0 commit comments

Comments
 (0)