Skip to content

Commit

Permalink
request RouterInfo if outdated
Browse files Browse the repository at this point in the history
  • Loading branch information
orignal committed Apr 6, 2014
1 parent 8d3fcff commit 1862896
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions NetDb.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -442,9 +442,11 @@ namespace data

if (dest->IsExploratory ())
{
if (!FindRouter (router)) // router with ident not found
auto r = FindRouter (router);
if (!r || i2p::util::GetMillisecondsSinceEpoch () > r->GetTimestamp () + 3600*1000LL)
{
LogPrint ("Found new router. Requesting RouterInfo ...");
// router with ident not found or too old (1 hour)
LogPrint ("Found new/outdated router. Requesting RouterInfo ...");
if (outbound && inbound)
{
RequestedDestination * d1 = CreateRequestedDestination (router, false, false);
Expand Down
2 changes: 1 addition & 1 deletion Transports.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ namespace i2p
// existing session not found. create new
// try NTCP first
auto address = r->GetNTCPAddress ();
if (address && !r->IsUnreachable ())
if (address && !r->UsesIntroducer () && !r->IsUnreachable ())
{
auto s = new i2p::ntcp::NTCPClient (m_Service, address->host, address->port, *r);
AddNTCPSession (s);
Expand Down

0 comments on commit 1862896

Please sign in to comment.