1
0

Lightning: Show sending and receiving capacity. Fixes #5967

This commit is contained in:
ThomasV
2020-02-19 16:03:21 +01:00
parent 3d42fca86e
commit 238fb46d87
4 changed files with 50 additions and 5 deletions

View File

@@ -1163,6 +1163,14 @@ class LNWallet(LNWorker):
with self.lock:
return Decimal(sum(chan.balance(LOCAL) if not chan.is_closed() else 0 for chan in self.channels.values()))/1000
def can_send(self):
with self.lock:
return Decimal(max(chan.available_to_spend(LOCAL) if chan.is_open() else 0 for chan in self.channels.values()))/1000
def can_receive(self):
with self.lock:
return Decimal(max(chan.available_to_spend(REMOTE) if chan.is_open() else 0 for chan in self.channels.values()))/1000
def list_channels(self):
encoder = MyEncoder()
with self.lock: