mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-07-12 14:12:27 +02:00
multi: merge DetermineFeePerKw
and Estimate
This commit moves `DetermineFeePerKw` into the `Estimate` method on `FeePreference`. A few callsites previously calling `DetermineFeePerKw` without the max fee rate is now also temporarily fixed by forcing them to use `Estimate` with the default sweeper max fee rate.
This commit is contained in:
12
rpcserver.go
12
rpcserver.go
@ -1175,11 +1175,13 @@ func (r *rpcServer) EstimateFee(ctx context.Context,
|
||||
// Query the fee estimator for the fee rate for the given confirmation
|
||||
// target.
|
||||
target := in.TargetConf
|
||||
feePerKw, err := sweep.DetermineFeePerKw(
|
||||
r.server.cc.FeeEstimator, sweep.FeePreference{
|
||||
ConfTarget: uint32(target),
|
||||
},
|
||||
)
|
||||
feePref := sweep.FeePreference{
|
||||
ConfTarget: uint32(target),
|
||||
}
|
||||
|
||||
// Since we are providing a fee estimation as an RPC response, there's
|
||||
// no need to set a max feerate here, so we use 0.
|
||||
feePerKw, err := feePref.Estimate(r.server.cc.FeeEstimator, 0)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
Reference in New Issue
Block a user