cleanup introducers at startup

This commit is contained in:
orignal 2014-09-08 21:53:55 -04:00
parent 73ddc05a6c
commit 98fd1c7dbc
2 changed files with 6 additions and 2 deletions

View File

@ -116,6 +116,10 @@ namespace i2p
break; break;
} }
} }
// delete previous introducers
for (auto& addr : addresses)
addr.introducers.clear ();
// update // update
UpdateRouterInfo (); UpdateRouterInfo ();
} }

View File

@ -1170,10 +1170,10 @@ namespace ssu
i2p::context.RemoveIntroducer (it); i2p::context.RemoveIntroducer (it);
} }
if (!numIntroducers) if (numIntroducers < SSU_MAX_NUM_INTRODUCERS)
{ {
// create new // create new
auto introducers = FindIntroducers (SSU_MAX_NUM_INTRODUCERS); auto introducers = FindIntroducers (SSU_MAX_NUM_INTRODUCERS - numIntroducers);
if (introducers.size () > 0) if (introducers.size () > 0)
{ {
for (auto it1: introducers) for (auto it1: introducers)