sweep: add a dedicated method to create sweeping txns

This takes the old `createSweepTx` and refactors it to be
sweep-specific. A sweeping txns differs from a normal tx as it doesn't
need to take outputs as params.
This commit is contained in:
yyforyongyu
2024-03-21 17:12:17 +08:00
parent 59fbcb18d5
commit 59526988cf
4 changed files with 269 additions and 7 deletions

View File

@@ -273,7 +273,11 @@ func getWeightEstimate(inputs []input.Input, outputs []*wire.TxOut,
err := weightEstimate.add(inp)
if err != nil {
log.Warn(err)
// TODO(yy): check if this is even possible? If so, we
// should return the error here instead of filtering!
log.Errorf("Failed to get weight estimate for "+
"input=%v, witnessType=%v: %v ", inp.OutPoint(),
inp.WitnessType(), err)
// Skip inputs for which no weight estimate can be
// given.