Browse Source

initialize context after start-up

pull/95/head
orignal 10 years ago
parent
commit
cba58a5965
  1. 1
      Daemon.cpp
  2. 4
      RouterContext.cpp
  3. 1
      RouterContext.h

1
Daemon.cpp

@ -51,6 +51,7 @@ namespace i2p
bool Daemon_Singleton::init(int argc, char* argv[]) bool Daemon_Singleton::init(int argc, char* argv[])
{ {
i2p::util::config::OptionParser(argc, argv); i2p::util::config::OptionParser(argc, argv);
i2p::context.Init ();
LogPrint("\n\n\n\ni2pd starting\n"); LogPrint("\n\n\n\ni2pd starting\n");
LogPrint("data directory: ", i2p::util::filesystem::GetDataDir().string()); LogPrint("data directory: ", i2p::util::filesystem::GetDataDir().string());

4
RouterContext.cpp

@ -13,6 +13,10 @@ namespace i2p
RouterContext::RouterContext (): RouterContext::RouterContext ():
m_LastUpdateTime (0) m_LastUpdateTime (0)
{
}
void RouterContext::Init ()
{ {
if (!Load ()) if (!Load ())
CreateNewRouter (); CreateNewRouter ();

1
RouterContext.h

@ -18,6 +18,7 @@ namespace i2p
public: public:
RouterContext (); RouterContext ();
void Init ();
i2p::data::RouterInfo& GetRouterInfo () { return m_RouterInfo; }; i2p::data::RouterInfo& GetRouterInfo () { return m_RouterInfo; };
const uint8_t * GetPrivateKey () const { return m_Keys.GetPrivateKey (); }; const uint8_t * GetPrivateKey () const { return m_Keys.GetPrivateKey (); };

Loading…
Cancel
Save