|
|
|
@ -19,7 +19,7 @@ namespace i2p
@@ -19,7 +19,7 @@ namespace i2p
|
|
|
|
|
|
|
|
|
|
RouterContext::RouterContext (): |
|
|
|
|
m_LastUpdateTime (0), m_AcceptsTunnels (true), m_IsFloodfill (false), |
|
|
|
|
m_StartupTime (0), m_ShareRatio (100), m_Status (eRouterStatusOK), |
|
|
|
|
m_ShareRatio (100), m_Status (eRouterStatusOK), |
|
|
|
|
m_Error (eRouterErrorNone), m_NetID (I2PD_NET_ID) |
|
|
|
|
{ |
|
|
|
|
} |
|
|
|
@ -27,7 +27,7 @@ namespace i2p
@@ -27,7 +27,7 @@ namespace i2p
|
|
|
|
|
void RouterContext::Init () |
|
|
|
|
{ |
|
|
|
|
srand (i2p::util::GetMillisecondsSinceEpoch () % 1000); |
|
|
|
|
m_StartupTime = i2p::util::GetSecondsSinceEpoch (); |
|
|
|
|
m_StartupTime = std::chrono::steady_clock::now(); |
|
|
|
|
if (!Load ()) |
|
|
|
|
CreateNewRouter (); |
|
|
|
|
m_Decryptor = m_Keys.CreateDecryptor (nullptr); |
|
|
|
@ -716,7 +716,7 @@ namespace i2p
@@ -716,7 +716,7 @@ namespace i2p
|
|
|
|
|
|
|
|
|
|
uint32_t RouterContext::GetUptime () const |
|
|
|
|
{ |
|
|
|
|
return i2p::util::GetSecondsSinceEpoch () - m_StartupTime; |
|
|
|
|
return std::chrono::duration_cast<std::chrono::seconds> (std::chrono::steady_clock::now() - m_StartupTime).count (); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
bool RouterContext::Decrypt (const uint8_t * encrypted, uint8_t * data, BN_CTX * ctx) const |
|
|
|
|