commit 40fcf58fec376d6b6f9c301f2186093e93c553f8
parent 2b9be294a0666387a1165e67494350992ad6ba51
Author: ThomasV <thomasv@electrum.org>
Date: Thu, 7 Jun 2018 08:56:00 +0200
lightning: display remote balance in gui
Diffstat:
3 files changed, 10 insertions(+), 4 deletions(-)
diff --git a/electrum/gui/qt/main_window.py b/electrum/gui/qt/main_window.py
@@ -1055,7 +1055,7 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, Logger):
self.request_list.update()
def create_lightning_request(self, amount, message, expiration):
- req = self.wallet.lnworker.add_invoice(amount)
+ req = self.wallet.lnworker.add_invoice(amount, message)
def create_bitcoin_request(self, amount, message, expiration):
addr = self.wallet.get_unused_address()
diff --git a/electrum/gui/qt/request_list.py b/electrum/gui/qt/request_list.py
@@ -157,6 +157,7 @@ class RequestList(MyTreeView):
break
else:
description = ''
+ date = format_time(lnaddr.date)
labels = [date, r, '', description, amount_str, '']
items = [QStandardItem(e) for e in labels]
items.setIcon(2, QIcon(":icons/lightning.png"))
diff --git a/gui/qt/channels_list.py b/gui/qt/channels_list.py
@@ -10,19 +10,24 @@ class ChannelsList(MyTreeWidget):
update_single_row = QtCore.pyqtSignal(OpenChannel)
def __init__(self, parent):
- MyTreeWidget.__init__(self, parent, self.create_menu, [_('Node ID'), _('Capacity'), _('Balance'), _('Status')], 0)
+ MyTreeWidget.__init__(self, parent, self.create_menu, [_('Node ID'), _('Balance'), _('Remote'), _('Status')], 0)
self.main_window = parent
self.update_rows.connect(self.do_update_rows)
self.update_single_row.connect(self.do_update_single_row)
def format_fields(self, chan):
status = self.parent.wallet.lnworker.channel_state[chan.channel_id]
- return [bh2u(chan.node_id), self.parent.format_amount(chan.constraints.capacity), self.parent.format_amount(chan.local_state.amount_msat//1000), status]
+ return [
+ bh2u(chan.node_id),
+ self.parent.format_amount(chan.local_state.amount_msat//1000),
+ self.parent.format_amount(chan.remote_state.amount_msat//1000),
+ status
+ ]
def create_menu(self, position):
menu = QtWidgets.QMenu()
cur = self.currentItem()
- print('ID', cur.data(0, QtCore.Qt.UserRole))
+ print('ID', bh2u(cur.data(0, QtCore.Qt.UserRole)))
def close():
print("closechannel result", self.parent.wallet.lnworker.close_channel_from_other_thread(cur.di))
menu.addAction(_("Close channel"), close)