Skip to content
Snippets Groups Projects
Commit 9ee136fc authored by inso's avatar inso
Browse files

Small bugfix

parent 895ceea7
No related branches found
No related tags found
No related merge requests found
...@@ -27,7 +27,6 @@ Qt Client for [Ucoin](http://www.ucoin.io) project. ...@@ -27,7 +27,6 @@ Qt Client for [Ucoin](http://www.ucoin.io) project.
### Todo ### Todo
* Joining a community, publishing keys * Joining a community, publishing keys
* Multiple wallets management * Multiple wallets management
* More user-friendly coins transfer
* Cutecoin keyring * Cutecoin keyring
### How to install ### How to install
......
...@@ -79,8 +79,12 @@ class MainWindow(QMainWindow, Ui_MainWindow): ...@@ -79,8 +79,12 @@ class MainWindow(QMainWindow, Ui_MainWindow):
if self.core.current_account is None: if self.core.current_account is None:
self.tabs_account.setEnabled(False) self.tabs_account.setEnabled(False)
self.menu_contacts.setEnabled(False)
self.menu_actions.setEnabled(False)
else: else:
self.tabs_account.setEnabled(True) self.tabs_account.setEnabled(True)
self.menu_contacts.setEnabled(True)
self.menu_actions.setEnabled(True)
self.label_account_name.setText( self.label_account_name.setText(
"Current account : " + "Current account : " +
self.core.current_account.name) self.core.current_account.name)
......
...@@ -85,7 +85,11 @@ class Wallet(object): ...@@ -85,7 +85,11 @@ class Wallet(object):
server=self.trusts()[0].server, server=self.trusts()[0].server,
port=self.trusts()[0].port) port=self.trusts()[0].port)
wht_request = ucoin.network.Wallet(recipient.fingerprint) try:
wht_request = ucoin.network.Wallet(recipient.fingerprint)
except ValueError as e:
return str(e)
recipient_wht = self.request(wht_request) recipient_wht = self.request(wht_request)
nodes = self.get_nodes_in_peering(recipient_wht['entry']['trusts']) nodes = self.get_nodes_in_peering(recipient_wht['entry']['trusts'])
nodes += [h for h in self.hosters() if h not in nodes] nodes += [h for h in self.hosters() if h not in nodes]
...@@ -195,18 +199,15 @@ Hosters: ...@@ -195,18 +199,15 @@ Hosters:
return nodes return nodes
def request(self, request, get_args={}): def request(self, request, get_args={}):
error = None
for node in self.trusts(): for node in self.trusts():
logging.debug("Trying to connect to : " + node.get_text()) logging.debug("Trying to connect to : " + node.get_text())
node.use(request) node.use(request)
try: try:
data = request.get(**get_args) data = request.get(**get_args)
return data return data
except ValueError as e:
error = str(e)
except: except:
continue continue
return error return None
def post(self, request, get_args={}): def post(self, request, get_args={}):
error = None error = None
...@@ -214,12 +215,11 @@ Hosters: ...@@ -214,12 +215,11 @@ Hosters:
logging.debug("Trying to connect to : " + node.get_text()) logging.debug("Trying to connect to : " + node.get_text())
node.use(request) node.use(request)
try: try:
data = request.post(**get_args) request.post(**get_args)
except ValueError as e: except ValueError as e:
error = str(e) error = str(e)
except: except:
continue continue
return data
return error return error
def broadcast(self, nodes, request, get_args={}): def broadcast(self, nodes, request, get_args={}):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment