From 39c19aa1b618f757f0fb3b1bf0dcee6a29af3fca Mon Sep 17 00:00:00 2001
From: Inso <insomniak.fr@gmail.com>
Date: Sat, 14 Mar 2015 11:00:21 +0100
Subject: [PATCH] Fixed a bug in network watching

---
 src/cutecoin/core/app.py        | 2 +-
 src/cutecoin/gui/network_tab.py | 5 ++++-
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/cutecoin/core/app.py b/src/cutecoin/core/app.py
index f5e76c5d..3268a007 100644
--- a/src/cutecoin/core/app.py
+++ b/src/cutecoin/core/app.py
@@ -251,7 +251,7 @@ class Application(QObject):
                                         community.currency + '_network')
 
             with open(network_path, 'w') as outfile:
-                data = community.jsonify_network()
+                data['network'] = community.jsonify_network()
                 data['version'] = __version__
                 json.dump(data, outfile, indent=4, sort_keys=True)
 
diff --git a/src/cutecoin/gui/network_tab.py b/src/cutecoin/gui/network_tab.py
index 0fc50f13..aad3e04a 100644
--- a/src/cutecoin/gui/network_tab.py
+++ b/src/cutecoin/gui/network_tab.py
@@ -31,7 +31,6 @@ class NetworkTabWidget(QWidget, Ui_NetworkTabWidget):
         self.watcher_thread = QThread()
         self.network_watcher.moveToThread(self.watcher_thread)
         self.watcher_thread.started.connect(self.network_watcher.watch)
-        self.watcher_thread.start()
 
         community.network.nodes_changed.connect(self.refresh_nodes)
 
@@ -43,3 +42,7 @@ class NetworkTabWidget(QWidget, Ui_NetworkTabWidget):
         self.network_watcher.deleteLater()
         self.watcher_thread.deleteLater()
 
+    def showEvent(self, event):
+        super().showEvent(event)
+        self.watcher_thread.start()
+
-- 
GitLab