loopout: fix fee estimate failure if conf_target=1

The fee estimator fails if conf_target=1. Use conf_target=2 instead.

Fix https://github.com/lightninglabs/loop/issues/898
This commit is contained in:
Boris Nagaev 2025-03-18 10:58:23 -03:00
parent a253b40062
commit ddeb43d293
No known key found for this signature in database
2 changed files with 10 additions and 10 deletions

View file

@ -136,14 +136,14 @@ func (p *loopOutSweepFeerateProvider) GetConfTargetAndFeeRate(
// opens for the client to sweep.
blocksUntilExpiry := contract.CltvExpiry - height
// Find confTarget. If the sweep has expired, use confTarget=1, because
// confTarget must be positive.
// Find confTarget. If the sweep has expired, use confTarget=2, because
// fee estimator fails if confTarget < 2.
confTarget := blocksUntilExpiry
if confTarget <= 0 {
if confTarget < 2 {
log.Infof("Swap %x has expired (blocksUntilExpiry=%d), using "+
"confTarget=1 for it.", swapHash[:6], blocksUntilExpiry)
"confTarget=2 for it.", swapHash[:6], blocksUntilExpiry)
confTarget = 1
confTarget = 2
}
feeFactor := float64(1.0)