Skip to content

Commit

Permalink
never delete conneted router from netdb
Browse files Browse the repository at this point in the history
  • Loading branch information
orignal committed Feb 27, 2024
1 parent a8af683 commit ca45fe7
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions libi2pd/NetDb.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -672,10 +672,11 @@ namespace data
(CreateRoutingKey (it.second->GetIdentHash ()) ^ i2p::context.GetIdentHash ()).metric[0] >= 0x02)) // different first 7 bits
it.second->SetUnreachable (true);
}
if (it.second->IsUnreachable () && i2p::transport::transports.IsConnected (it.second->GetIdentHash ()))
it.second->SetUnreachable (false); // don't expire connected router
}

// make router reachable back if connected now
if (it.second->IsUnreachable () && i2p::transport::transports.IsConnected (it.second->GetIdentHash ()))
it.second->SetUnreachable (false);

if (it.second->IsUnreachable ())
{
if (it.second->IsFloodfill ()) deletedFloodfillsCount++;
Expand Down

0 comments on commit ca45fe7

Please sign in to comment.