Skip to content
Snippets Groups Projects
Commit 576870e5 authored by inso's avatar inso
Browse files

Merge branch 'dev' of https://github.com/ucoin-io/cutecoin into dev

parents 7468820d 56a7a8e6
No related branches found
No related tags found
No related merge requests found
......@@ -169,12 +169,13 @@ class BmaAccess(QObject):
tries += 1
except ClientError:
tries += 1
except TimeoutError:
except asyncio.TimeoutError:
tries += 1
if len(nodes) == 0 or json_data is None:
raise NoPeerAvailable("", len(nodes))
return json_data
@asyncio.coroutine
def simple_request(self, request, req_args={}, get_args={}):
"""
Start a request to the network but don't cache its result.
......@@ -199,11 +200,12 @@ class BmaAccess(QObject):
tries += 1
except ClientError:
tries += 1
except TimeoutError:
except asyncio.TimeoutError:
tries += 1
else:
raise NoPeerAvailable("", len(nodes))
@asyncio.coroutine
def broadcast(self, request, req_args={}, post_args={}):
"""
Broadcast data to a network.
......@@ -233,7 +235,7 @@ class BmaAccess(QObject):
raise
except ClientError:
pass
except TimeoutError:
except asyncio.TimeoutError:
pass
else:
raise NoPeerAvailable("", len(nodes))
......
......@@ -442,6 +442,12 @@ class Node(QObject):
except ValueError as e:
logging.debug("Error in leaf reply")
self.changed.emit()
except ClientError:
logging.debug("Client error : {0}".format(self.pubkey))
self.state = Node.OFFLINE
except asyncio.TimeoutError:
logging.debug("Timeout error : {0}".format(self.pubkey))
self.state = Node.OFFLINE
self._last_merkle = {'root' : peers_data['root'],
'leaves': peers_data['leaves']}
except ValueError as e:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment