Browse Source

different cost for direct or with introducers SSU address

pull/1638/head
orignal 4 years ago
parent
commit
ae58a7007b
  1. 2
      libi2pd/RouterContext.cpp
  2. 2
      libi2pd/RouterInfo.cpp

2
libi2pd/RouterContext.cpp

@ -432,6 +432,7 @@ namespace i2p
for (auto& addr : addresses) for (auto& addr : addresses)
if (addr->ssu) if (addr->ssu)
{ {
addr->cost = 11;
addr->caps &= ~i2p::data::RouterInfo::eSSUIntroducer; // can't be introducer addr->caps &= ~i2p::data::RouterInfo::eSSUIntroducer; // can't be introducer
addr->ssu->introducers.clear (); addr->ssu->introducers.clear ();
port = addr->port; port = addr->port;
@ -459,6 +460,7 @@ namespace i2p
for (auto& addr : addresses) for (auto& addr : addresses)
if (addr->ssu) if (addr->ssu)
{ {
addr->cost = 9;
addr->caps |= i2p::data::RouterInfo::eSSUIntroducer; addr->caps |= i2p::data::RouterInfo::eSSUIntroducer;
addr->ssu->introducers.clear (); addr->ssu->introducers.clear ();
port = addr->port; port = addr->port;

2
libi2pd/RouterInfo.cpp

@ -772,7 +772,7 @@ namespace data
addr->host = boost::asio::ip::address::from_string (host); addr->host = boost::asio::ip::address::from_string (host);
addr->port = port; addr->port = port;
addr->transportStyle = eTransportSSU; addr->transportStyle = eTransportSSU;
addr->cost = 10; // NTCP2 should have priority over SSU addr->cost = 9; // NTCP2 should have priority over SSU
addr->caps = i2p::data::RouterInfo::eSSUTesting | i2p::data::RouterInfo::eSSUIntroducer; // BC; addr->caps = i2p::data::RouterInfo::eSSUTesting | i2p::data::RouterInfo::eSSUIntroducer; // BC;
addr->date = 0; addr->date = 0;
addr->ssu.reset (new SSUExt ()); addr->ssu.reset (new SSUExt ());

Loading…
Cancel
Save