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:
4 files changed
+35
-22
No files matched your search
+2
-2
@@ -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