mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-08-26 21:51:27 +02:00
sweep: make sure max fee rate can be reached
Previously we don't allow confTarget to be 0, which ended up the final position being never reached. We fix it here by allowing confTarget to be 0 in case the deadline has already been passed for a given input.
This commit is contained in:
@@ -951,11 +951,11 @@ func calcCurrentConfTarget(currentHeight, deadline int32) uint32 {
|
||||
|
||||
// If we are already past the deadline, we will set the conf target to
|
||||
// be 1.
|
||||
if deadlineDelta <= 0 {
|
||||
if deadlineDelta < 0 {
|
||||
log.Warnf("Deadline is %d blocks behind current height %v",
|
||||
-deadlineDelta, currentHeight)
|
||||
|
||||
confTarget = 1
|
||||
confTarget = 0
|
||||
} else {
|
||||
confTarget = uint32(deadlineDelta)
|
||||
}
|
||||
|
Reference in New Issue
Block a user