@@ -593,12 +593,14 @@ func (m *Manager) dispatchBestEasyAutoloopSwap(ctx context.Context) error {
593
593
return err
594
594
}
595
595
596
+ usableChannels := make ([]lndclient.ChannelInfo , 0 , len (channels ))
596
597
localTotal := btcutil .Amount (0 )
597
598
for _ , channel := range channels {
598
599
if channelIsCustom (channel ) {
599
600
continue
600
601
}
601
602
localTotal += channel .LocalBalance
603
+ usableChannels = append (usableChannels , channel )
602
604
}
603
605
604
606
// 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 {
640
642
builder := newLoopOutBuilder (m .cfg )
641
643
642
644
channel := m .pickEasyAutoloopChannel (
643
- channels , restrictions , loopOut , loopIn ,
645
+ usableChannels , restrictions , loopOut , loopIn , 0 ,
644
646
)
645
647
if channel == nil {
646
648
return fmt .Errorf ("no eligible channel for easy autoloop" )
@@ -1651,7 +1653,7 @@ func (m *Manager) waitForSwapPayment(ctx context.Context, swapHash lntypes.Hash,
1651
1653
// swap conflicts.
1652
1654
func (m * Manager ) pickEasyAutoloopChannel (channels []lndclient.ChannelInfo ,
1653
1655
restrictions * Restrictions , loopOut []* loopdb.LoopOut ,
1654
- loopIn []* loopdb.LoopIn ) * lndclient.ChannelInfo {
1656
+ loopIn []* loopdb.LoopIn , satsPerAsset float64 ) * lndclient.ChannelInfo {
1655
1657
1656
1658
traffic := m .currentSwapTraffic (loopOut , loopIn )
1657
1659
0 commit comments