don't connect to self

pull/439/head
Jeff Becker 5 years ago
parent 91298c4819
commit 0fa8325e4e
No known key found for this signature in database
GPG Key ID: F357B3B42F6F9B05

@ -161,6 +161,9 @@ namespace llarp
bool
Router::TryConnectAsync(RouterContact remote, uint16_t numretries)
{
const RouterID us = pubkey();
if(remote.pubkey == us)
return false;
// do we already have a pending job for this remote?
if(HasPendingConnectJob(remote.pubkey))
{
@ -611,6 +614,9 @@ namespace llarp
void
Router::TryEstablishTo(const RouterID &remote)
{
const RouterID us = pubkey();
if(us == remote)
return;
if(!ConnectionToRouterAllowed(remote))
{
LogWarn("not connecting to ", remote, " as it's not permitted by config");

Loading…
Cancel
Save