sweep: assign deadline values to inputs in handleNewInput

This commit changes how we transform from a deadline option to a
concrete deadline value - previously this is done when we decide to
cluster inputs, and we now move it to a step earlier - once an input is
received via `SweeperInput`, we will immediately transform its optional
deadline into a real value. For inputs that come with a deadline option,
since the Some will be used, it makes no difference. For inputs with
None as their deadlines, we need this change to make sure the default
deadlines are assigned accurately.
This commit is contained in:
yyforyongyu
2024-04-16 03:15:34 +08:00
parent 96883f307c
commit a50cdd64c5
5 changed files with 44 additions and 46 deletions

View File

@ -2747,9 +2747,7 @@ func TestSweepPendingInputs(t *testing.T) {
pis := make(InputsMap)
// Mock the aggregator to return the mocked input sets.
expectedDeadlineUsed := testHeight + DefaultDeadlineDelta
aggregator.On("ClusterInputs", pis,
expectedDeadlineUsed).Return([]InputSet{
aggregator.On("ClusterInputs", pis).Return([]InputSet{
setNeedWallet, normalSet,
})