electrum

Electrum Bitcoin wallet
git clone https://git.parazyd.org/electrum
Log | Files | Refs | Submodules

commit aeb58dbd66d79315e6843f77dfe5e4a78d4500c6
parent 6f246b90bfc24c534d21aee8ccec8aa69cefbd39
Author: ThomasV <thomasv@electrum.org>
Date:   Wed,  6 Jun 2018 17:42:06 +0200

do not pass channel list to update_rows signal, as it is sent to all windows

Diffstat:
Mgui/qt/channels_list.py | 11+++++------
Mlib/lnworker.py | 2+-
2 files changed, 6 insertions(+), 7 deletions(-)

diff --git a/gui/qt/channels_list.py b/gui/qt/channels_list.py @@ -6,7 +6,7 @@ from electrum.lnbase import OpenChannel from .util import MyTreeWidget, SortableTreeWidgetItem class ChannelsList(MyTreeWidget): - update_rows = QtCore.pyqtSignal(list) + update_rows = QtCore.pyqtSignal() update_single_row = QtCore.pyqtSignal(OpenChannel) def __init__(self, parent): @@ -36,10 +36,10 @@ class ChannelsList(MyTreeWidget): for i, v in enumerate(self.format_fields(chan)): item.setData(i, QtCore.Qt.DisplayRole, v) - @QtCore.pyqtSlot(list) - def do_update_rows(self, channels): + @QtCore.pyqtSlot() + def do_update_rows(self): self.clear() - for chan in channels: + for chan in self.parent.wallet.lnworker.channels.values(): item = SortableTreeWidgetItem(self.format_fields(chan)) item.setData(0, QtCore.Qt.UserRole, chan.channel_id) self.insertTopLevelItem(0, item) @@ -50,8 +50,7 @@ class ChannelsList(MyTreeWidget): push_amt_inp = QtWidgets.QLineEdit(self, text='0') button = QtWidgets.QPushButton(_('Open channel'), self) button.clicked.connect(lambda: self.main_window.protect(self.open_channel, (nodeid_inp, local_amt_inp, push_amt_inp))) - l=QtWidgets.QVBoxLayout(self) - h=QtWidgets.QGridLayout(self) + h = QtWidgets.QGridLayout() nodeid_label = QtWidgets.QLabel(self) nodeid_label.setText(_("Node ID")) local_amt_label = QtWidgets.QLabel(self) diff --git a/lib/lnworker.py b/lib/lnworker.py @@ -176,7 +176,7 @@ class LNWorker(PrintError): self.on_channels_updated() def on_channels_updated(self): - self.network.trigger_callback('channels', list(self.channels.values())) + self.network.trigger_callback('channels') def open_channel(self, node_id, local_amt_sat, push_amt_sat, pw): coro = self._open_channel_coroutine(node_id, local_amt_sat, push_amt_sat, None if pw == "" else pw)