prevent crash

This commit is contained in:
Jeff Becker 2019-05-14 10:27:12 -04:00
parent 686fb311ad
commit d9463d534c
No known key found for this signature in database
GPG Key ID: F357B3B42F6F9B05
1 changed files with 4 additions and 2 deletions

View File

@ -78,6 +78,7 @@ struct TryConnectJob
router->FlushOutboundFor(rc.pubkey, link);
}
/// return true to remove
bool
Timeout()
{
@ -94,12 +95,13 @@ struct TryConnectJob
return true;
}
/// return true to remove
bool
Attempt()
{
--triesLeft;
if(!link)
return false;
return true;
if(!link->TryEstablishTo(rc))
{
return true;
@ -120,7 +122,7 @@ on_try_connecting(void *u)
{
TryConnectJob *j = static_cast< TryConnectJob * >(u);
if(!j->Attempt())
if(j->Attempt())
j->router->pendingEstablishJobs.erase(j->rc.pubkey);
}