From 358e621710c2c5238a1b733d0574f90634615acc Mon Sep 17 00:00:00 2001 From: Dmitri Bogomolov <4glitch@gmail.com> Date: Wed, 4 Jul 2018 18:41:21 +0300 Subject: [PATCH] Round peer rating to 2 decimal places before saving knownnodes --- src/knownnodes.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/knownnodes.py b/src/knownnodes.py index 5755efc0..5ffd65d1 100644 --- a/src/knownnodes.py +++ b/src/knownnodes.py @@ -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 })