Skip to content

Commit 0a12675

Browse files
committed
liquidity: skip asset channels in easy autoloop
1 parent 5d19b1d commit 0a12675

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
@@ -597,12 +597,14 @@ func (m *Manager) dispatchBestEasyAutoloopSwap(ctx context.Context) error {
597597
return err
598598
}
599599

600+
usableChannels := make([]lndclient.ChannelInfo, 0, len(channels))
600601
localTotal := btcutil.Amount(0)
601602
for _, channel := range channels {
602603
if channelIsCustom(channel) {
603604
continue
604605
}
605606
localTotal += channel.LocalBalance
607+
usableChannels = append(usableChannels, channel)
606608
}
607609

608610
// Since we're only autolooping-out we need to check if we are below
@@ -644,7 +646,7 @@ func (m *Manager) dispatchBestEasyAutoloopSwap(ctx context.Context) error {
644646
builder := newLoopOutBuilder(m.cfg)
645647

646648
channel := m.pickEasyAutoloopChannel(
647-
channels, restrictions, loopOut, loopIn,
649+
usableChannels, restrictions, loopOut, loopIn,
648650
)
649651
if channel == nil {
650652
return fmt.Errorf("no eligible channel for easy autoloop")

0 commit comments

Comments
 (0)