Fix a deadlock when link fails to establish

This commit is contained in:
Michael 2019-08-07 00:27:41 +01:00
parent 3d2dfcc027
commit be211926cf
No known key found for this signature in database
GPG Key ID: 2D51757B47E2434C
1 changed files with 2 additions and 1 deletions

View File

@ -192,7 +192,7 @@ namespace llarp
const RouterContact &rc)
{
{
util::Lock l(&_mutex);
util::ReleasableLock l(&_mutex);
// in case other request found RC for this router after this request was
// made
@ -206,6 +206,7 @@ namespace llarp
if(!link)
{
l.Release();
FinalizeRequest(router, SessionResult::NoLink);
return;
}