mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-11-27 22:53:43 +01:00
sweep+cnct+nursery+rpc: extract DetermineFeePerKw to func, add FeePreference
In this commit, we extract the existing determineFeePerKw method on the RPC server into a new file in the sweep package. Along the way, we consolidate code by introducing a new FeePreference struct, which allows the caller to express their fee preference either in blocks to confirmation, or a direct fee rate. This move takes a small step to father decoupling calls in the main RPC server.
This commit is contained in:
@@ -750,10 +750,10 @@ func (s *UtxoSweeper) waitForSpend(outpoint wire.OutPoint,
|
||||
// - Make handling re-orgs easier.
|
||||
// - Thwart future possible fee sniping attempts.
|
||||
// - Make us blend in with the bitcoind wallet.
|
||||
func (s *UtxoSweeper) CreateSweepTx(inputs []Input, confTarget uint32,
|
||||
func (s *UtxoSweeper) CreateSweepTx(inputs []Input, feePref FeePreference,
|
||||
currentBlockHeight uint32) (*wire.MsgTx, error) {
|
||||
|
||||
feePerKw, err := s.cfg.FeeEstimator.EstimateFeePerKW(confTarget)
|
||||
feePerKw, err := DetermineFeePerKw(s.cfg.FeeEstimator, feePref)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user