return bool when trying to establish link layer session

pull/72/head
Jeff Becker 6 years ago
parent a202bc58a8
commit c1377851a6
No known key found for this signature in database
GPG Key ID: F357B3B42F6F9B05

@ -67,7 +67,7 @@ namespace llarp
bool
PickAddress(const RouterContact& rc, AddressInfo& picked) const;
void
bool
TryEstablishTo(const RouterContact& rc);
bool

@ -118,17 +118,18 @@ namespace llarp
return false;
}
void
bool
ILinkLayer::TryEstablishTo(const RouterContact& rc)
{
llarp::AddressInfo to;
if(!PickAddress(rc, to))
return;
return false;
llarp::LogInfo("Try establish to ", rc.pubkey);
llarp::Addr addr(to);
auto s = NewOutboundSession(rc, to);
s->Start();
PutSession(s);
return true;
}
bool

@ -79,7 +79,9 @@ struct TryConnectJob
Attempt()
{
--triesLeft;
link->TryEstablishTo(rc);
if(!link->TryEstablishTo(rc))
llarp::LogError("did not attempt connection to ", rc.pubkey,
" and it has ", rc.addrs.size(), " advertised addresses");
}
bool

Loading…
Cancel
Save