Fix import of pickled knownnodes.dat
This commit is contained in:
parent
95e300d7ca
commit
4c184d8ffe
|
@ -60,9 +60,10 @@ def pickle_deserialize_old_knownnodes(source):
|
||||||
the old format was {Peer:lastseen, ...}
|
the old format was {Peer:lastseen, ...}
|
||||||
the new format is {Peer:{"lastseen":i, "rating":f}}
|
the new format is {Peer:{"lastseen":i, "rating":f}}
|
||||||
"""
|
"""
|
||||||
|
global knownNodes # pylint: disable=global-statement
|
||||||
knownNodes = pickle.load(source)
|
knownNodes = pickle.load(source)
|
||||||
for stream in knownNodes.keys():
|
for stream in knownNodes.keys():
|
||||||
for node, params in knownNodes[stream].items():
|
for node, params in knownNodes[stream].iteritems():
|
||||||
if isinstance(params, (float, int)):
|
if isinstance(params, (float, int)):
|
||||||
addKnownNode(stream, node, params)
|
addKnownNode(stream, node, params)
|
||||||
|
|
||||||
|
|
Reference in New Issue
Block a user