Fix import of pickled knownnodes.dat

This commit is contained in:
Dmitri Bogomolov 2018-10-02 12:35:35 +03:00
parent 95e300d7ca
commit 4c184d8ffe
Signed by untrusted user: g1itch
GPG Key ID: 720A756F18DEED13

View File

@ -60,9 +60,10 @@ def pickle_deserialize_old_knownnodes(source):
the old format was {Peer:lastseen, ...}
the new format is {Peer:{"lastseen":i, "rating":f}}
"""
global knownNodes # pylint: disable=global-statement
knownNodes = pickle.load(source)
for stream in knownNodes.keys():
for node, params in knownNodes[stream].items():
for node, params in knownNodes[stream].iteritems():
if isinstance(params, (float, int)):
addKnownNode(stream, node, params)