sweep: allow force sweeps

This commit is contained in:
Joost Jager committed 2020-01-15 16:56:44 +01:00
1 parent 14237f5fd4
commit b0aae13d70
9 files changed
+172 -90

No files matched your search

+8
View File
@@ -67,6 +67,14 @@ func generateInputPartitionings(sweepableInputs []txInput,
}
sort.Slice(sweepableInputs, func(i, j int) bool {
// Because of the specific ordering and termination condition
// that is described above, we place force sweeps at the start
// of the list. Otherwise we can't be sure that they will be
// included in an input set.
if sweepableInputs[i].parameters().Force {
return true
}
return yields[*sweepableInputs[i].OutPoint()] >
yields[*sweepableInputs[j].OutPoint()]
})