electrum

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

commit ba2211f52e6cfafaac468e9635210a5eb2a96f5c
parent bf7deaa1fb2ac3b608305db3e30b32ff7c7d05ce
Author: ThomasV <thomasv@electrum.org>
Date:   Thu, 13 Jul 2017 17:23:24 +0200

network dialog: refresh display on each new header

Diffstat:
Mgui/qt/network_dialog.py | 3+--
Mlib/network.py | 9++++-----
2 files changed, 5 insertions(+), 7 deletions(-)

diff --git a/gui/qt/network_dialog.py b/gui/qt/network_dialog.py @@ -46,9 +46,8 @@ class NetworkDialog(QDialog): vbox = QVBoxLayout(self) vbox.addLayout(self.nlayout.layout()) vbox.addLayout(Buttons(CloseButton(self))) - self.connect(self, QtCore.SIGNAL('updated'), self.on_update) - network.register_callback(self.on_network, ['updated']) + network.register_callback(self.on_network, ['updated', 'interfaces']) def on_network(self, event, *args): self.emit(QtCore.SIGNAL('updated'), event, *args) diff --git a/lib/network.py b/lib/network.py @@ -205,7 +205,7 @@ class Network(util.DaemonThread): config = {} # Do not use mutables as default values! util.DaemonThread.__init__(self) self.config = SimpleConfig(config) if type(config) == type({}) else config - self.num_server = 18 if not self.config.get('oneserver') else 0 + self.num_server = 10 if not self.config.get('oneserver') else 0 self.blockchains = { 0:Blockchain(self.config, 'blockchain_headers', None) } for x in os.listdir(self.config.path): if x.startswith('blockchain_fork_'): @@ -215,7 +215,6 @@ class Network(util.DaemonThread): self.blockchain_index = config.get('blockchain_index', 0) if self.blockchain_index not in self.blockchains.keys(): self.blockchain_index = 0 - # Server for addresses and transactions self.default_server = self.config.get('server') # Sanitize default server @@ -512,6 +511,7 @@ class Network(util.DaemonThread): if filtered: choice = random.choice(filtered) self.switch_to_interface(choice) + self.notify('updated') def switch_to_interface(self, server): '''Switch to server as our interface. If no connection exists nor @@ -1004,9 +1004,8 @@ class Network(util.DaemonThread): self.request_header(interface, height - 1) else: pass - if interface == self.interface: - self.switch_lagging_interface() - self.notify('updated') + self.switch_lagging_interface() + self.notify('interfaces') def blockchain(self): if self.interface and self.interface.blockchain is not None: