sweep: remove unused param Fee
This commit is contained in:
3 files changed
-45
No files matched your search
@@ -99,8 +99,6 @@ func (c *anchorResolver) Resolve(_ bool) (ContractResolver, error) {
|
|||||||
// After a restart or when the remote force closes, the sweeper is not
|
// After a restart or when the remote force closes, the sweeper is not
|
||||||
// yet aware of the anchor. In that case, it will be added as new input
|
// yet aware of the anchor. In that case, it will be added as new input
|
||||||
// to the sweeper.
|
// to the sweeper.
|
||||||
relayFeeRate := c.Sweeper.RelayFeePerKW()
|
|
||||||
|
|
||||||
witnessType := input.CommitmentAnchor
|
witnessType := input.CommitmentAnchor
|
||||||
|
|
||||||
// For taproot channels, we need to use the proper witness type.
|
// For taproot channels, we need to use the proper witness type.
|
||||||
@@ -116,9 +114,6 @@ func (c *anchorResolver) Resolve(_ bool) (ContractResolver, error) {
|
|||||||
resultChan, err := c.Sweeper.SweepInput(
|
resultChan, err := c.Sweeper.SweepInput(
|
||||||
&anchorInput,
|
&anchorInput,
|
||||||
sweep.Params{
|
sweep.Params{
|
||||||
Fee: sweep.FeeEstimateInfo{
|
|
||||||
FeeRate: relayFeeRate,
|
|
||||||
},
|
|
||||||
// For normal anchor sweeping, the budget is 330 sats.
|
// For normal anchor sweeping, the budget is 330 sats.
|
||||||
Budget: btcutil.Amount(
|
Budget: btcutil.Amount(
|
||||||
anchorInput.SignDesc().Output.Value,
|
anchorInput.SignDesc().Output.Value,
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
package contractcourt
|
package contractcourt
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
|
||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
@@ -135,20 +134,6 @@ func (s *mockSweeper) SweepInput(input input.Input, params sweep.Params) (
|
|||||||
|
|
||||||
s.sweptInputs <- input
|
s.sweptInputs <- input
|
||||||
|
|
||||||
// TODO(yy): replace mockSweeper with `mock.Mock`.
|
|
||||||
if params.Fee != nil {
|
|
||||||
fee, ok := params.Fee.(sweep.FeeEstimateInfo)
|
|
||||||
if !ok {
|
|
||||||
return nil, fmt.Errorf("unexpected fee type: %T",
|
|
||||||
params.Fee)
|
|
||||||
}
|
|
||||||
|
|
||||||
// Update the deadlines used if it's set.
|
|
||||||
if fee.ConfTarget != 0 {
|
|
||||||
s.deadlines = append(s.deadlines, int(fee.ConfTarget))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Update the deadlines used if it's set.
|
// Update the deadlines used if it's set.
|
||||||
params.DeadlineHeight.WhenSome(func(d int32) {
|
params.DeadlineHeight.WhenSome(func(d int32) {
|
||||||
s.deadlines = append(s.deadlines, int(d))
|
s.deadlines = append(s.deadlines, int(d))
|
||||||
|
|||||||
@@ -43,11 +43,6 @@ var (
|
|||||||
|
|
||||||
// Params contains the parameters that control the sweeping process.
|
// Params contains the parameters that control the sweeping process.
|
||||||
type Params struct {
|
type Params struct {
|
||||||
// Fee is the fee preference of the client who requested the input to be
|
|
||||||
// swept. If a confirmation target is specified, then we'll map it into
|
|
||||||
// a fee rate whenever we attempt to cluster inputs for a sweep.
|
|
||||||
Fee FeePreference
|
|
||||||
|
|
||||||
// ExclusiveGroup is an identifier that, if set, prevents other inputs
|
// ExclusiveGroup is an identifier that, if set, prevents other inputs
|
||||||
// with the same identifier from being batched together.
|
// with the same identifier from being batched together.
|
||||||
ExclusiveGroup *uint64
|
ExclusiveGroup *uint64
|
||||||
@@ -211,13 +206,6 @@ func (p *SweeperInput) String() string {
|
|||||||
return fmt.Sprintf("%v (%v)", p.Input.OutPoint(), p.Input.WitnessType())
|
return fmt.Sprintf("%v (%v)", p.Input.OutPoint(), p.Input.WitnessType())
|
||||||
}
|
}
|
||||||
|
|
||||||
// parameters returns the sweep parameters for this input.
|
|
||||||
//
|
|
||||||
// NOTE: Part of the txInput interface.
|
|
||||||
func (p *SweeperInput) parameters() Params {
|
|
||||||
return p.params
|
|
||||||
}
|
|
||||||
|
|
||||||
// terminated returns a boolean indicating whether the input has reached a
|
// terminated returns a boolean indicating whether the input has reached a
|
||||||
// final state.
|
// final state.
|
||||||
func (p *SweeperInput) terminated() bool {
|
func (p *SweeperInput) terminated() bool {
|
||||||
@@ -512,18 +500,6 @@ func (s *UtxoSweeper) SweepInput(inp input.Input,
|
|||||||
return nil, errors.New("nil input received")
|
return nil, errors.New("nil input received")
|
||||||
}
|
}
|
||||||
|
|
||||||
// Ensure the client provided a sane fee preference.
|
|
||||||
//
|
|
||||||
// TODO(yy): remove this check?
|
|
||||||
if params.Fee != nil {
|
|
||||||
_, err := params.Fee.Estimate(
|
|
||||||
s.cfg.FeeEstimator, s.cfg.MaxFeeRate.FeePerKWeight(),
|
|
||||||
)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
absoluteTimeLock, _ := inp.RequiredLockTime()
|
absoluteTimeLock, _ := inp.RequiredLockTime()
|
||||||
log.Infof("Sweep request received: out_point=%v, witness_type=%v, "+
|
log.Infof("Sweep request received: out_point=%v, witness_type=%v, "+
|
||||||
"relative_time_lock=%v, absolute_time_lock=%v, amount=%v, "+
|
"relative_time_lock=%v, absolute_time_lock=%v, amount=%v, "+
|
||||||
@@ -1145,7 +1121,6 @@ func (s *UtxoSweeper) handleUpdateReq(req *updateReq) (
|
|||||||
// Create the updated parameters struct. Leave the exclusive group
|
// Create the updated parameters struct. Leave the exclusive group
|
||||||
// unchanged.
|
// unchanged.
|
||||||
newParams := Params{
|
newParams := Params{
|
||||||
Fee: req.params.Fee,
|
|
||||||
StartingFeeRate: req.params.StartingFeeRate,
|
StartingFeeRate: req.params.StartingFeeRate,
|
||||||
Immediate: req.params.Immediate,
|
Immediate: req.params.Immediate,
|
||||||
Budget: req.params.Budget,
|
Budget: req.params.Budget,
|
||||||
|
|||||||
Reference in new issue
Block a user