mirror of
https://github.com/PurpleI2P/i2pd
synced 2024-11-13 01:20:22 +03:00
use received RouterInfo if older than one in netdb
This commit is contained in:
parent
37d3d9e604
commit
0c943f4405
@ -1126,12 +1126,14 @@ namespace transport
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
// update RouterInfo in netdb
|
// update RouterInfo in netdb
|
||||||
ri = i2p::data::netdb.AddRouterInfo (ri->GetBuffer (), ri->GetBufferLen ()); // ri points to one from netdb now
|
auto ri1 = i2p::data::netdb.AddRouterInfo (ri->GetBuffer (), ri->GetBufferLen ()); // ri points to one from netdb now
|
||||||
if (!ri)
|
if (!ri1)
|
||||||
{
|
{
|
||||||
LogPrint (eLogError, "SSU2: Couldn't update RouterInfo from SessionConfirmed in netdb");
|
LogPrint (eLogError, "SSU2: Couldn't update RouterInfo from SessionConfirmed in netdb");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
if (ri->GetTimestamp () >= ri1->GetTimestamp ()) ri = ri1; // received RouterInfo is not older than one in netdb
|
||||||
|
|
||||||
m_Address = m_RemoteEndpoint.address ().is_v6 () ? ri->GetSSU2V6Address () : ri->GetSSU2V4Address ();
|
m_Address = m_RemoteEndpoint.address ().is_v6 () ? ri->GetSSU2V6Address () : ri->GetSSU2V4Address ();
|
||||||
if (!m_Address || memcmp (S, m_Address->s, 32))
|
if (!m_Address || memcmp (S, m_Address->s, 32))
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user