Browse Source

cleanup introducers at startup

pull/97/head
orignal 10 years ago
parent
commit
98fd1c7dbc
  1. 4
      RouterContext.cpp
  2. 4
      SSU.cpp

4
RouterContext.cpp

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

4
SSU.cpp

@ -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)

Loading…
Cancel
Save