1
0

lnchannel: implement freezing channels (for receiving)

A bit weird, I know... :)
It allows for rebalancing our own channels! :P
This commit is contained in:
SomberNight
2020-03-26 07:09:38 +01:00
parent 79d202485e
commit 3ed6afce64
4 changed files with 56 additions and 31 deletions

View File

@@ -1266,12 +1266,7 @@ class LNWallet(LNWorker):
if chan.short_channel_id is not None}
# note: currently we add *all* our channels; but this might be a privacy leak?
for chan in channels:
# check channel is open
if chan.get_state() != channel_states.OPEN:
continue
# check channel has sufficient balance
# FIXME because of on-chain fees of ctx, this check is insufficient
if amount_sat and chan.balance(REMOTE) // 1000 < amount_sat:
if not chan.can_receive(amount_sat, check_frozen=True):
continue
chan_id = chan.short_channel_id
assert isinstance(chan_id, bytes), chan_id