mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2026-10-05 23:08:01 +00:00
always call find_node from bucket with own node. Call find_node more often
This commit is contained in:
@@ -299,7 +299,7 @@ namespace torrents
|
||||
auto bucket = m_Buckets;
|
||||
while (bucket)
|
||||
{
|
||||
if (!bucket->IsFull () && !bucket->nodes.empty ())
|
||||
if ((!bucket->IsFull () || bucket->IsInBucket (m_OurNode)) && !bucket->nodes.empty ())
|
||||
{
|
||||
auto randomID = bucket->GetRandomID (rng);
|
||||
auto closestNode = FindClosestNodeInBucket (randomID);
|
||||
@@ -506,7 +506,7 @@ namespace torrents
|
||||
std::set<std::shared_ptr<Node>, std::function<bool(const std::shared_ptr<Node>&, const std::shared_ptr<Node>&)> >
|
||||
sortedNodes ([](const std::shared_ptr<Node>& n1, const std::shared_ptr<Node>& n2)->bool
|
||||
{
|
||||
return n2->id > n1->id;
|
||||
return n1->id > n2->id;
|
||||
});
|
||||
while (f.read ((char *)nodeInfo.data (), nodeInfo.size ()))
|
||||
{
|
||||
|
||||
@@ -40,7 +40,7 @@ namespace torrents
|
||||
constexpr int DHT_UPDATE_CHECK_INTERVAL = 24; // in seconds
|
||||
constexpr int DHT_EXPIRATION_CHECK_INTERVAL = 73; // in seconds
|
||||
constexpr int DHT_SEND_PING_CHECK_INTERVAL = 38; // in seconds
|
||||
constexpr int DHT_EXPLORATORY_INTERVAL = 4*60; // in seconds
|
||||
constexpr int DHT_EXPLORATORY_INTERVAL = 130; // in seconds
|
||||
constexpr int DHT_EXPLORATORY_INTERVAL_VARIANCE = 40; // in seconds
|
||||
constexpr int DHT_INITIAL_EXPLORATORY_INTERVAL = 90; // in seconds
|
||||
constexpr int DHT_NODE_SEND_PING_TIME = 740; // in seconds
|
||||
|
||||
Reference in New Issue
Block a user