Skip to content

Commit 012baa4

Browse files
committed
liquidity: skip asset channels in easy autoloop
1 parent 624d445 commit 012baa4

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

liquidity/liquidity.go

+3-1
Original file line numberDiff line numberDiff line change
@@ -593,12 +593,14 @@ func (m *Manager) dispatchBestEasyAutoloopSwap(ctx context.Context) error {
593593
return err
594594
}
595595

596+
usableChannels := make([]lndclient.ChannelInfo, 0, len(channels))
596597
localTotal := btcutil.Amount(0)
597598
for _, channel := range channels {
598599
if channelIsCustom(channel) {
599600
continue
600601
}
601602
localTotal += channel.LocalBalance
603+
usableChannels = append(usableChannels, channel)
602604
}
603605

604606
// Since we're only autolooping-out we need to check if we are below
@@ -640,7 +642,7 @@ func (m *Manager) dispatchBestEasyAutoloopSwap(ctx context.Context) error {
640642
builder := newLoopOutBuilder(m.cfg)
641643

642644
channel := m.pickEasyAutoloopChannel(
643-
channels, restrictions, loopOut, loopIn,
645+
usableChannels, restrictions, loopOut, loopIn,
644646
)
645647
if channel == nil {
646648
return fmt.Errorf("no eligible channel for easy autoloop")

0 commit comments

Comments
 (0)