From bf38aed87fcc9b1a3e4e9e6fd411e629fcc1825a Mon Sep 17 00:00:00 2001 From: ziggie Date: Wed, 24 Jul 2024 15:01:47 +0200 Subject: [PATCH] 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. --- server.go | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/server.go b/server.go index 7ae6ed21e..a3b128406 100644 --- a/server.go +++ b/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