mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-04-28 11:47:48 +02:00
store RouterInfo in DHT
This commit is contained in:
parent
ebee6c5f13
commit
abf687ff09
4 changed files with 177 additions and 72 deletions
|
@ -1355,15 +1355,12 @@ namespace data
|
|||
}
|
||||
|
||||
std::shared_ptr<const RouterInfo> NetDb::GetClosestFloodfill (const IdentHash& destination,
|
||||
const std::set<IdentHash>& excluded, bool closeThanUsOnly) const
|
||||
const std::set<IdentHash>& excluded) const
|
||||
{
|
||||
std::shared_ptr<const RouterInfo> r;
|
||||
XORMetric minMetric;
|
||||
IdentHash destKey = CreateRoutingKey (destination);
|
||||
if (closeThanUsOnly)
|
||||
minMetric = destKey ^ i2p::context.GetIdentHash ();
|
||||
else
|
||||
minMetric.SetMax ();
|
||||
minMetric.SetMax ();
|
||||
std::unique_lock<std::mutex> l(m_FloodfillsMutex);
|
||||
for (const auto& it: m_Floodfills)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue