swap intros should only swap intros

This commit is contained in:
Jeff Becker 2019-02-21 13:00:37 -05:00
parent eecc00211f
commit c7e100787b
No known key found for this signature in database
GPG Key ID: F357B3B42F6F9B05

View File

@ -1142,29 +1142,7 @@ namespace llarp
Endpoint::OutboundContext::SwapIntros() Endpoint::OutboundContext::SwapIntros()
{ {
remoteIntro = m_NextIntro; remoteIntro = m_NextIntro;
// prepare next intro m_DataHandler->PutIntroFor(currentConvoTag, remoteIntro);
auto now = Now();
for(const auto& intro : currentIntroSet.I)
{
if(intro.ExpiresSoon(now))
continue;
if(m_BadIntros.find(intro) == m_BadIntros.end()
&& remoteIntro.router == intro.router)
{
m_NextIntro = intro;
return;
}
}
for(const auto& intro : currentIntroSet.I)
{
if(intro.ExpiresSoon(now))
continue;
if(m_BadIntros.find(intro) == m_BadIntros.end())
{
m_NextIntro = intro;
return;
}
}
} }
bool bool