mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-02-22 22:25:24 +01:00
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
1 changed files with 9 additions and 1 deletions
|
@ -484,7 +484,15 @@ func (a *Agent) controller() {
|
|||
availableFunds, numChans := a.cfg.Constraints.ChannelBudget(
|
||||
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
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue