Round peer rating to 2 decimal places before saving knownnodes

This commit is contained in:
Dmitri Bogomolov 2018-07-04 18:41:21 +03:00
parent 342e2a209c
commit 358e621710
Signed by untrusted user: g1itch
GPG Key ID: 720A756F18DEED13

View File

@ -37,6 +37,7 @@ def json_serialize_knownnodes(output):
_serialized = []
for stream, peers in knownNodes.iteritems():
for peer, info in peers.iteritems():
info.update(rating=round(info.get('rating', 0), 2))
_serialized.append({
'stream': stream, 'peer': peer._asdict(), 'info': info
})