sweep: change MaxInputsPerTx from int to uint32

This commit is contained in:
yyforyongyu committed 2024-04-19 21:33:26 +08:00
1 parent 521b1fc34a
commit d0a8f27d84
5 files changed
+9 -9

No files matched your search

+3 -3
View File
@@ -139,7 +139,7 @@ type txInputSet struct {
// maxInputs is the maximum number of inputs that will be accepted in
// the set.
maxInputs int
maxInputs uint32
}
// Compile-time constraint to ensure txInputSet implements InputSet.
@@ -147,7 +147,7 @@ var _ InputSet = (*txInputSet)(nil)
// newTxInputSet constructs a new, empty input set.
func newTxInputSet(feePerKW, maxFeeRate chainfee.SatPerKWeight,
maxInputs int) *txInputSet {
maxInputs uint32) *txInputSet {
state := txInputSetState{
feeRate: feePerKW,
@@ -215,7 +215,7 @@ func (t *txInputSet) addToState(inp input.Input,
// Stop if max inputs is reached. Do not count additional wallet inputs,
// because we don't know in advance how many we may need.
if constraints != constraintsWallet &&
len(t.inputs) >= t.maxInputs {
uint32(len(t.inputs)) >= t.maxInputs {
return nil
}