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

Fixing bug when lloading a new account

parent 490cb9dc
No related branches found
No related tags found
No related merge requests found
...@@ -62,6 +62,8 @@ class Cache(): ...@@ -62,6 +62,8 @@ class Cache():
Refreshing the cache just clears every last requests which Refreshing the cache just clears every last requests which
cannot be saved because they can change from one block to another. cannot be saved because they can change from one block to another.
''' '''
logging.debug("Refresh : {0}/{1}".format(self.latest_block,
self.community.network.latest_block))
if self.latest_block < self.community.network.latest_block: if self.latest_block < self.community.network.latest_block:
self.latest_block = self.community.network.latest_block self.latest_block = self.community.network.latest_block
self.data = {k: self.data[k] for k in self.data.keys() self.data = {k: self.data[k] for k in self.data.keys()
...@@ -86,10 +88,6 @@ class Cache(): ...@@ -86,10 +88,6 @@ class Cache():
result = self.community.request(request, req_args, get_args, result = self.community.request(request, req_args, get_args,
cached=False) cached=False)
# Do not cache block 0
if self.latest_block == 0:
return result
else:
self.data[cache_key] = result self.data[cache_key] = result
return self.data[cache_key] return self.data[cache_key]
else: else:
...@@ -371,6 +369,7 @@ class Community(QObject): ...@@ -371,6 +369,7 @@ class Community(QObject):
''' '''
Start the refresh processing of the cache Start the refresh processing of the cache
''' '''
# We have to refresh node before refresh cache
self._cache.refresh() self._cache.refresh()
def request(self, request, req_args={}, get_args={}, cached=True): def request(self, request, req_args={}, get_args={}, cached=True):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment