Browse Source

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

dependabot/pip/contrib/deterministic-build/ecdsa-0.13.3
ThomasV 7 years ago
parent
commit
aeb58dbd66
  1. 11
      gui/qt/channels_list.py
  2. 2
      lib/lnworker.py

11
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)

2
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)

Loading…
Cancel
Save