1
0

lightning channels reserves: use pretty balance in Qt, fix bugs, add tests

This commit is contained in:
Janus
2018-10-24 20:39:07 +02:00
committed by ThomasV
parent eb4e6b2e54
commit a5a7c1406e
4 changed files with 163 additions and 27 deletions

View File

@@ -25,12 +25,12 @@ class ChannelsList(MyTreeWidget):
def format_fields(self, chan):
labels = {}
for subject in (REMOTE, LOCAL):
available = chan.available_to_spend(subject)//1000
label = self.parent.format_amount(available)
bal_minus_htlcs = chan.balance_minus_outgoing_htlcs(subject)//1000
label = self.parent.format_amount(bal_minus_htlcs)
bal_other = chan.balance(-subject)//1000
available_other = chan.available_to_spend(-subject)//1000
if bal_other != available_other:
label += ' (+' + self.parent.format_amount(bal_other - available_other) + ')'
bal_minus_htlcs_other = chan.balance_minus_outgoing_htlcs(-subject)//1000
if bal_other != bal_minus_htlcs_other:
label += ' (+' + self.parent.format_amount(bal_other - bal_minus_htlcs_other) + ')'
labels[subject] = label
return [
bh2u(chan.node_id),