autopilot/agent: return early if no funds available
If there are less funds available than the minumum channel size, there's no reason to score candidates, so we continue early.
This commit is contained in:
parent
d0c4e253c6
commit
d5f3714f86
@ -484,7 +484,15 @@ func (a *Agent) controller() {
|
|||||||
availableFunds, numChans := a.cfg.Constraints.ChannelBudget(
|
availableFunds, numChans := a.cfg.Constraints.ChannelBudget(
|
||||||
totalChans, a.totalBalance,
|
totalChans, a.totalBalance,
|
||||||
)
|
)
|
||||||
if numChans == 0 {
|
switch {
|
||||||
|
case numChans == 0:
|
||||||
|
continue
|
||||||
|
|
||||||
|
// If the amount is too small, we don't want to attempt opening
|
||||||
|
// another channel.
|
||||||
|
case availableFunds == 0:
|
||||||
|
continue
|
||||||
|
case availableFunds < a.cfg.Constraints.MinChanSize():
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user