introducers in local RouterInfo

This commit is contained in:
orignal 2014-09-01 17:34:20 -04:00
parent da9c281d9a
commit 30ffda7708
4 changed files with 110 additions and 2 deletions

View file

@ -80,6 +80,22 @@ namespace i2p
UpdateRouterInfo ();
}
void RouterContext::AddIntroducer (const i2p::data::RouterInfo& routerInfo, uint32_t tag)
{
auto address = routerInfo.GetSSUAddress ();
if (address)
{
if (m_RouterInfo.AddIntroducer (address, tag))
UpdateRouterInfo ();
}
}
void RouterContext::RemoveIntroducer (uint32_t tag)
{
if (m_RouterInfo.RemoveIntroducer (tag))
UpdateRouterInfo ();
}
bool RouterContext::Load ()
{
std::ifstream fk (i2p::util::filesystem::GetFullPath (ROUTER_KEYS).c_str (), std::ifstream::binary | std::ofstream::in);