sweep: return fees from method createSweepTx

Which will be used to make the sweeper RBF-aware.
This commit is contained in:
yyforyongyu
2023-10-25 14:13:23 +08:00
parent e86843da6e
commit 1ace1fdf4c
3 changed files with 28 additions and 13 deletions

View File

@@ -1163,7 +1163,7 @@ func (s *UtxoSweeper) sweep(inputs inputSet, feeRate chainfee.SatPerKWeight,
}
// Create sweep tx.
tx, err := createSweepTx(
tx, _, err := createSweepTx(
inputs, nil, s.currentOutputScript, uint32(currentHeight),
feeRate, s.cfg.MaxFeeRate.FeePerKWeight(), s.cfg.Signer,
)
@@ -1467,10 +1467,12 @@ func (s *UtxoSweeper) CreateSweepTx(inputs []input.Input, feePref FeePreference,
return nil, err
}
return createSweepTx(
tx, _, err := createSweepTx(
inputs, nil, pkScript, currentBlockHeight, feePerKw,
s.cfg.MaxFeeRate.FeePerKWeight(), s.cfg.Signer,
)
return tx, err
}
// DefaultNextAttemptDeltaFunc is the default calculation for next sweep attempt