diff --git a/README.md b/README.md index 60c30edbe1559be622beb2315f03dcd6f1f79e58..beb816a74478926f66b3565b11a170ab5ae6305f 100644 --- a/README.md +++ b/README.md @@ -41,7 +41,7 @@ Qt Client for [Ucoin](http://www.ucoin.io) project. * The executable is generated in "build" folder, named "cutecoin" ### How to download latest release - * Go to the [current release](https://github.com/ucoin-io/cutecoin/releases/tag/0.8.2) + * Go to the [current release](https://github.com/ucoin-io/cutecoin/releases/tag/0.9.0) * Download the package corresponding to your operating system * Unzip and start "cutecoin" :) * Join our beta community by contacting us on ucoin forums : forum.ucoin.io diff --git a/src/cutecoin/core/community.py b/src/cutecoin/core/community.py index 171fc81389386cfce46577012a0a0bc6758c1437..93451ef8f159969a1d0b6635d16dbc4908748635 100644 --- a/src/cutecoin/core/community.py +++ b/src/cutecoin/core/community.py @@ -17,8 +17,7 @@ from requests.exceptions import RequestException class Cache(): - _saved_requests = [hash(bma.blockchain.Block), - hash(bma.wot.Lookup)] + _saved_requests = [str(bma.blockchain.Block)] def __init__(self, community): ''' @@ -48,6 +47,8 @@ class Cache(): :return: The cache as a dict in json format ''' + #TODO: Change the requests caching because hashed keys are different + #from a cutecoin run to another data = {k: self.data[k] for k in self.data.keys() if k[0] in Cache._saved_requests} entries = [] @@ -75,11 +76,11 @@ class Cache(): :param req_args: The arguments passed to the request constructor :param get_args: The arguments passed to the requests __get__ method ''' - cache_key = (hash(request), - hash(tuple(frozenset(sorted(req_args.keys())))), - hash(tuple(frozenset(sorted(req_args.items())))), - hash(tuple(frozenset(sorted(get_args.keys())))), - hash(tuple(frozenset(sorted(get_args.items()))))) + cache_key = (str(request), + str(tuple(frozenset(sorted(req_args.keys())))), + str(tuple(frozenset(sorted(req_args.items())))), + str(tuple(frozenset(sorted(get_args.keys())))), + str(tuple(frozenset(sorted(get_args.items()))))) if cache_key not in self.data.keys(): result = self.community.request(request, req_args, get_args, diff --git a/src/cutecoin/core/net/network.py b/src/cutecoin/core/net/network.py index bab907d6ff7544dd4026eb3802010b65f585a281..26b1948d5defe43b781816ff08a365707d3e17b3 100644 --- a/src/cutecoin/core/net/network.py +++ b/src/cutecoin/core/net/network.py @@ -3,10 +3,6 @@ Created on 24 févr. 2015 @author: inso ''' - -from ucoinpy.documents.peer import Peer, BMAEndpoint -from ucoinpy.api import bma - from .node import Node import logging @@ -166,6 +162,7 @@ class Network(QObject): node.check_sync(block_max) #TODO: Offline nodes for too long have to be removed + #TODO: Corrupted nodes should maybe be removed faster ? logging.debug("Nodes found : {0}".format(nodes))