From 1862896532782566db0cb71c7a48ed3e12ee5ef1 Mon Sep 17 00:00:00 2001 From: orignal Date: Sat, 5 Apr 2014 21:25:54 -0400 Subject: [PATCH] request RouterInfo if outdated --- NetDb.cpp | 6 ++++-- Transports.cpp | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/NetDb.cpp b/NetDb.cpp index 1855ac30..553ee52b 100644 --- a/NetDb.cpp +++ b/NetDb.cpp @@ -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); diff --git a/Transports.cpp b/Transports.cpp index 10c27afd..9d86d605 100644 --- a/Transports.cpp +++ b/Transports.cpp @@ -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);