mirror of
https://github.com/PurpleI2P/i2pd
synced 2024-11-10 08:00:38 +03:00
initialize router identity
This commit is contained in:
parent
8d75d51803
commit
a96d70a94c
@ -23,6 +23,8 @@ namespace transport
|
|||||||
m_RemoteRouterInfo (in_RemoteRouterInfo), m_ReceiveBufferOffset (0),
|
m_RemoteRouterInfo (in_RemoteRouterInfo), m_ReceiveBufferOffset (0),
|
||||||
m_NextMessage (nullptr), m_NumSentBytes (0), m_NumReceivedBytes (0)
|
m_NextMessage (nullptr), m_NumSentBytes (0), m_NumReceivedBytes (0)
|
||||||
{
|
{
|
||||||
|
if (m_RemoteRouterInfo)
|
||||||
|
m_RemoteRouterIdentity = m_RemoteRouterInfo->GetRouterIdentity ();
|
||||||
m_DHKeysPair = transports.GetNextDHKeysPair ();
|
m_DHKeysPair = transports.GetNextDHKeysPair ();
|
||||||
m_Establisher = new Establisher;
|
m_Establisher = new Establisher;
|
||||||
}
|
}
|
||||||
@ -118,14 +120,8 @@ namespace transport
|
|||||||
|
|
||||||
void NTCPSession::ClientLogin ()
|
void NTCPSession::ClientLogin ()
|
||||||
{
|
{
|
||||||
if (!m_RemoteRouterInfo)
|
|
||||||
{
|
|
||||||
LogPrint ("Remote router info is not set");
|
|
||||||
Terminate ();
|
|
||||||
}
|
|
||||||
if (!m_DHKeysPair)
|
if (!m_DHKeysPair)
|
||||||
m_DHKeysPair = transports.GetNextDHKeysPair ();
|
m_DHKeysPair = transports.GetNextDHKeysPair ();
|
||||||
m_RemoteRouterIdentity = m_RemoteRouterInfo->GetRouterIdentity ();
|
|
||||||
// send Phase1
|
// send Phase1
|
||||||
const uint8_t * x = m_DHKeysPair->publicKey;
|
const uint8_t * x = m_DHKeysPair->publicKey;
|
||||||
memcpy (m_Establisher->phase1.pubKey, x, 256);
|
memcpy (m_Establisher->phase1.pubKey, x, 256);
|
||||||
@ -634,11 +630,8 @@ namespace transport
|
|||||||
void NTCPServerConnection::Connected ()
|
void NTCPServerConnection::Connected ()
|
||||||
{
|
{
|
||||||
LogPrint ("NTCP server session connected");
|
LogPrint ("NTCP server session connected");
|
||||||
SetIsEstablished (true);
|
|
||||||
transports.AddNTCPSession (this);
|
transports.AddNTCPSession (this);
|
||||||
|
NTCPSession::Connected ();
|
||||||
SendTimeSyncMessage ();
|
|
||||||
SendI2NPMessage (CreateDatabaseStoreMsg ()); // we tell immediately who we are
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user