From 929f727a6a09ba84c76977a597214476cac4ac17 Mon Sep 17 00:00:00 2001 From: arvidn Date: Fri, 26 Jul 2019 13:13:13 -0700 Subject: [PATCH] fix dht_stats_alert routing table stats for multi-homed clients (temporary hack for 1.2.x series) --- src/kademlia/routing_table.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/kademlia/routing_table.cpp b/src/kademlia/routing_table.cpp index 57d527e4b..e285dac57 100644 --- a/src/kademlia/routing_table.cpp +++ b/src/kademlia/routing_table.cpp @@ -130,6 +130,12 @@ int routing_table::bucket_limit(int bucket) const void routing_table::status(std::vector& s) const { + // TODO: This is temporary. For now, only report the largest routing table + // (of potentially multiple ones, for multi-homed systems) + // in next major version, break the ABI and support reporting all of them in + // the dht_stats_alert + if (s.size() > m_buckets.size()) return; + s.clear(); for (auto const& i : m_buckets) { dht_routing_bucket b;