mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-01-22 08:14:15 +00:00
select reachable routers for one hop tunnels
This commit is contained in:
parent
876375f2c3
commit
ef85277a1b
@ -698,7 +698,7 @@ namespace tunnel
|
|||||||
auto inboundTunnel = GetNextInboundTunnel ();
|
auto inboundTunnel = GetNextInboundTunnel ();
|
||||||
auto router = i2p::transport::transports.RoutesRestricted() ?
|
auto router = i2p::transport::transports.RoutesRestricted() ?
|
||||||
i2p::transport::transports.GetRestrictedPeer() :
|
i2p::transport::transports.GetRestrictedPeer() :
|
||||||
i2p::data::netdb.GetRandomRouter ();
|
i2p::data::netdb.GetRandomRouter (i2p::context.GetSharedRouterInfo (), false); // reachable by us
|
||||||
if (!inboundTunnel || !router) return;
|
if (!inboundTunnel || !router) return;
|
||||||
LogPrint (eLogDebug, "Tunnel: creating one hop outbound tunnel");
|
LogPrint (eLogDebug, "Tunnel: creating one hop outbound tunnel");
|
||||||
CreateTunnel<OutboundTunnel> (
|
CreateTunnel<OutboundTunnel> (
|
||||||
@ -771,7 +771,8 @@ namespace tunnel
|
|||||||
// trying to create one more inbound tunnel
|
// trying to create one more inbound tunnel
|
||||||
auto router = i2p::transport::transports.RoutesRestricted() ?
|
auto router = i2p::transport::transports.RoutesRestricted() ?
|
||||||
i2p::transport::transports.GetRestrictedPeer() :
|
i2p::transport::transports.GetRestrictedPeer() :
|
||||||
i2p::data::netdb.GetRandomRouter ();
|
// should be reachable by us because we send build request directly
|
||||||
|
i2p::data::netdb.GetRandomRouter (i2p::context.GetSharedRouterInfo (), false);
|
||||||
if (!router) {
|
if (!router) {
|
||||||
LogPrint (eLogWarning, "Tunnel: can't find any router, skip creating tunnel");
|
LogPrint (eLogWarning, "Tunnel: can't find any router, skip creating tunnel");
|
||||||
return;
|
return;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user