sweep: isolate min fee rate bucket

This commit is contained in:
Joost Jager 2019-12-09 12:17:58 +01:00
parent dc6c4637b6
commit 1c93e9e03d
No known key found for this signature in database
GPG Key ID: A61B9D4C393C59C7

@ -714,7 +714,15 @@ func (s *UtxoSweeper) sweepCluster(cluster inputCluster,
func (s *UtxoSweeper) bucketForFeeRate(
feeRate chainfee.SatPerKWeight) int {
return int(feeRate-s.relayFeeRate) / s.cfg.FeeRateBucketSize
// Create an isolated bucket for sweeps at the minimum fee rate. This is
// to prevent very small outputs (anchors) from becoming uneconomical if
// their fee rate would be averaged with higher fee rate inputs in a
// regular bucket.
if feeRate == s.relayFeeRate {
return 0
}
return 1 + int(feeRate-s.relayFeeRate)/s.cfg.FeeRateBucketSize
}
// clusterBySweepFeeRate takes the set of pending inputs within the UtxoSweeper