From 50709cbd21d530613fa10ed6423f81a9554acadc Mon Sep 17 00:00:00 2001 From: Adam Ierymenko Date: Tue, 3 Sep 2019 12:44:09 -0700 Subject: [PATCH] Fix siblings in peers list, fix meter. --- node/Meter.hpp | 24 +++++++++++++++--------- root/root.cpp | 3 +++ 2 files changed, 18 insertions(+), 9 deletions(-) diff --git a/node/Meter.hpp b/node/Meter.hpp index 58def766a..b02699509 100644 --- a/node/Meter.hpp +++ b/node/Meter.hpp @@ -53,34 +53,40 @@ public: { _lock.lock(); const int64_t since = now - _ts; - if (since >= 1000) { + if (since >= ZT_METER_HISTORY_TICK_DURATION) { _ts = now; for(int i=1;i= ZT_METER_HISTORY_TICK_DURATION) { + r += (double)_count / ((double)since / 1000.0); + n += 1.0; + } + for(int i=0;isibling = true; siblings.push_back(rp); + peersByIdentity[id] = rp; + peersByVirtAddr[id.address()].insert(rp); + peersByPhysAddr[ip].insert(rp); } else { printf("FATAL: invalid JSON while parsing siblings section in config file: sibling entry is not a JSON object" ZT_EOL_S); return 1;