C-Otto / rebalance-lnd

A script that can be used to balance lightning channels of a lnd node
MIT License
343 stars 82 forks source link

Rebalance in reckless mode picking wrong channel. #330

Closed akshit-modi closed 6 months ago

akshit-modi commented 6 months ago

Hi team, I have multiple channels with the same peer. I want to rebalance on one specific channel only. But when i run rebalance script it is picking random channel in each try and rebalance any one of the channel with the same peer.

Command run: rebalance.py -f -t -a 300000 --fee-limit 700 --reckless

So for example, i have 3 channels. Channels 1: aaaaaa (Peer: abc) Channels 2: bbbbbb (Peer: xyz) Channels 3: cccccc (Peer: xyz)

When i run, rebalance.py -f aaaaaa -t bbbbbb -a 300000 --fee-limit 700 --reckless, it outputs like,

Trying route #1 (fee 301,525 mSAT, 602ppm)
self         to  aaaaaa                   (free, we usually charge 2,000ppm)
aaaaaa  to  xxxxxx                   (fee  250,025 mSAT,   499ppm)
xxxxxxx to  bbbbbb                  (fee  250,025 mSAT,   499ppm)

Temporary channel failure
Ignoring aaaaaa (aaaaaa to bfx-lnd1)
Considering route with high fees

Trying route #2 (fee 578,007 mSAT, 1,154ppm)
self        to  aaaaaa                   (free, we usually charge 2,000ppm)
aaaaaa  to  xxxxxx                   (fee  250,025 mSAT,   499ppm)
xxxxxxx to  cccccc                  (fee  250,025 mSAT,   499ppm)

Here both the channel (bbbbbb, cccccc) belongs to same peer. We have faced the same issue with multiple channels, where we have multiple channels with same peer.

C-Otto commented 6 months ago

You can't influence which channel your peer uses to send funds to you. This is a limitation of the LN itself and not an issue of rebalance-lnd. Note that, for this reason, with lnd-manageJ you can only pick the remote peer, not a specific channel (to some remote peer).