mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-09-05 17:05:50 +02:00
walletrpc+sweep: refactor BumpFee
to properly handle sweep request
This commit is contained in:
@@ -1087,14 +1087,6 @@ func (s *UtxoSweeper) handlePendingSweepsReq(
|
||||
func (s *UtxoSweeper) UpdateParams(input wire.OutPoint,
|
||||
params Params) (chan Result, error) {
|
||||
|
||||
// Ensure the client provided a sane fee preference.
|
||||
_, err := params.Fee.Estimate(
|
||||
s.cfg.FeeEstimator, s.cfg.MaxFeeRate.FeePerKWeight(),
|
||||
)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
responseChan := make(chan *updateResp, 1)
|
||||
select {
|
||||
case s.updateReqs <- &updateReq{
|
||||
@@ -1140,9 +1132,14 @@ func (s *UtxoSweeper) handleUpdateReq(req *updateReq) (
|
||||
|
||||
// Create the updated parameters struct. Leave the exclusive group
|
||||
// unchanged.
|
||||
newParams := sweeperInput.params
|
||||
newParams.Fee = req.params.Fee
|
||||
newParams.Immediate = req.params.Immediate
|
||||
newParams := Params{
|
||||
Fee: req.params.Fee,
|
||||
StartingFeeRate: req.params.StartingFeeRate,
|
||||
Immediate: req.params.Immediate,
|
||||
Budget: req.params.Budget,
|
||||
DeadlineHeight: req.params.DeadlineHeight,
|
||||
ExclusiveGroup: sweeperInput.params.ExclusiveGroup,
|
||||
}
|
||||
|
||||
log.Debugf("Updating parameters for %v(state=%v) from (%v) to (%v)",
|
||||
req.input, sweeperInput.state, sweeperInput.params, newParams)
|
||||
|
Reference in New Issue
Block a user