|
|
@ -166,6 +166,8 @@ namespace llarp
|
|
|
|
const RouterID us = pubkey();
|
|
|
|
const RouterID us = pubkey();
|
|
|
|
if(remote.pubkey == us)
|
|
|
|
if(remote.pubkey == us)
|
|
|
|
return false;
|
|
|
|
return false;
|
|
|
|
|
|
|
|
if(!ConnectionToRouterAllowed(remote.pubkey))
|
|
|
|
|
|
|
|
return false;
|
|
|
|
// do we already have a pending job for this remote?
|
|
|
|
// do we already have a pending job for this remote?
|
|
|
|
if(HasPendingConnectJob(remote.pubkey))
|
|
|
|
if(HasPendingConnectJob(remote.pubkey))
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -628,6 +630,7 @@ namespace llarp
|
|
|
|
const RouterID us = pubkey();
|
|
|
|
const RouterID us = pubkey();
|
|
|
|
if(us == remote)
|
|
|
|
if(us == remote)
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
|
|
if(!ConnectionToRouterAllowed(remote))
|
|
|
|
if(!ConnectionToRouterAllowed(remote))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
LogWarn("not connecting to ", remote, " as it's not permitted by config");
|
|
|
|
LogWarn("not connecting to ", remote, " as it's not permitted by config");
|
|
|
@ -1145,7 +1148,8 @@ namespace llarp
|
|
|
|
void
|
|
|
|
void
|
|
|
|
Router::SendTo(RouterID remote, const ILinkMessage *msg, ILinkLayer *selected)
|
|
|
|
Router::SendTo(RouterID remote, const ILinkMessage *msg, ILinkLayer *selected)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
METRICS_TIME_BLOCK("RouterSendTo", remote.ToString().c_str());
|
|
|
|
const std::string remoteName = "TX_" + remote.ToString();
|
|
|
|
|
|
|
|
METRICS_DYNAMIC_INCREMENT(msg->Name(), remoteName.c_str());
|
|
|
|
llarp_buffer_t buf(linkmsg_buffer);
|
|
|
|
llarp_buffer_t buf(linkmsg_buffer);
|
|
|
|
|
|
|
|
|
|
|
|
if(!msg->BEncode(&buf))
|
|
|
|
if(!msg->BEncode(&buf))
|
|
|
@ -1264,6 +1268,11 @@ namespace llarp
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if(rc.IsPublicRouter() && whitelistRouters && IsServiceNode())
|
|
|
|
if(rc.IsPublicRouter() && whitelistRouters && IsServiceNode())
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
if(lokinetRouters.size() == 0)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
LogError("we have no service nodes in whitelist");
|
|
|
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
}
|
|
|
|
if(lokinetRouters.find(rc.pubkey) == lokinetRouters.end())
|
|
|
|
if(lokinetRouters.find(rc.pubkey) == lokinetRouters.end())
|
|
|
|
{
|
|
|
|
{
|
|
|
|
RouterID sn(rc.pubkey);
|
|
|
|
RouterID sn(rc.pubkey);
|
|
|
|