contractcourt: specify deadline and budget for commit sweep

This commit is contained in:
yyforyongyu committed 2024-04-19 21:33:33 +08:00
1 parent aa44197f88
commit 01fd4e5642
4 files changed
+101 -19

No files matched your search

+11 -8
View File
@@ -129,15 +129,18 @@ func (s *mockSweeper) SweepInput(input input.Input, params sweep.Params) (
s.sweptInputs <- input
// TODO(yy): use `mock.Mock` to avoid the conversion.
fee, ok := params.Fee.(sweep.FeeEstimateInfo)
if !ok {
return nil, fmt.Errorf("unexpected fee type: %T", params.Fee)
}
// 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.
if fee.ConfTarget != 0 {
s.deadlines = append(s.deadlines, int(fee.ConfTarget))
}
}
result := make(chan sweep.Result, 1)