Round peer rating to 2 decimal places before saving knownnodes
This commit is contained in:
parent
342e2a209c
commit
358e621710
|
@ -37,6 +37,7 @@ def json_serialize_knownnodes(output):
|
||||||
_serialized = []
|
_serialized = []
|
||||||
for stream, peers in knownNodes.iteritems():
|
for stream, peers in knownNodes.iteritems():
|
||||||
for peer, info in peers.iteritems():
|
for peer, info in peers.iteritems():
|
||||||
|
info.update(rating=round(info.get('rating', 0), 2))
|
||||||
_serialized.append({
|
_serialized.append({
|
||||||
'stream': stream, 'peer': peer._asdict(), 'info': info
|
'stream': stream, 'peer': peer._asdict(), 'info': info
|
||||||
})
|
})
|
||||||
|
|
Reference in New Issue
Block a user