From 14eb418c5ea2d864db0a8ff1d758bd7cb7670eed Mon Sep 17 00:00:00 2001 From: orignal Date: Mon, 28 Sep 2026 22:37:42 -0400 Subject: [PATCH] remove empty buckets after load DHT nodes --- libi2pd_client/TorrentsDHT.cpp | 1 + libi2pd_client/TorrentsDHT.h | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/libi2pd_client/TorrentsDHT.cpp b/libi2pd_client/TorrentsDHT.cpp index 55644b5a..fc1f7643 100644 --- a/libi2pd_client/TorrentsDHT.cpp +++ b/libi2pd_client/TorrentsDHT.cpp @@ -498,6 +498,7 @@ namespace torrents } } } + m_RoutingTable->RemoveEmptyBuckets (); if (numLoaded > 0) LogPrint (eLogInfo, "TorrentsDHT: ", numLoaded, " DHT nodes loaded"); } diff --git a/libi2pd_client/TorrentsDHT.h b/libi2pd_client/TorrentsDHT.h index 541fd044..46dd20b5 100644 --- a/libi2pd_client/TorrentsDHT.h +++ b/libi2pd_client/TorrentsDHT.h @@ -123,11 +123,11 @@ namespace torrents std::list > GetExploratoryTargets (std::mt19937& rng) const; // (target, node to send find_node to) NodeID FindClosestNodeInBucket (const NodeID& target) const; std::list DeleteExpiredNodes (uint64_t ts); + void RemoveEmptyBuckets (); private: Bucket * FindBucket (const Torrent::InfoHash& id) const; - void RemoveEmptyBuckets (); private: