show uptime

This commit is contained in:
orignal 2015-02-23 14:41:56 -05:00
parent e002c05350
commit c46a82420d
3 changed files with 14 additions and 2 deletions

View file

@ -14,12 +14,13 @@ namespace i2p
RouterContext::RouterContext ():
m_LastUpdateTime (0), m_IsUnreachable (false), m_AcceptsTunnels (true),
m_IsFloodfill (false)
m_IsFloodfill (false), m_StartupTime (0)
{
}
void RouterContext::Init ()
{
m_StartupTime = i2p::util::GetSecondsSinceEpoch ();
if (!Load ())
CreateNewRouter ();
UpdateRouterInfo ();
@ -218,5 +219,10 @@ namespace i2p
void RouterContext::HandleI2NPMessage (const uint8_t * buf, size_t len, std::shared_ptr<i2p::tunnel::InboundTunnel> from)
{
i2p::HandleI2NPMessage (CreateI2NPMessage (buf, GetI2NPMessageLength (buf), from));
}
uint32_t RouterContext::GetUptime () const
{
return i2p::util::GetSecondsSinceEpoch () - m_StartupTime;
}
}