mirror of https://github.com/oxen-io/lokinet
propagate error to client
This commit is contained in:
parent
562f3f07ab
commit
f3e96e06b2
|
@ -259,6 +259,9 @@ namespace llarp
|
|||
if(self->context->CheckPathLimitHitByIP(self->fromAddr))
|
||||
{
|
||||
llarp::LogError("client path build limited ", self->hop->info);
|
||||
OnForwardLRCMResult(self->context->Router(), self->hop->info.rxID,
|
||||
self->hop->info.downstream, self->hop->pathKey,
|
||||
SendStatus::Congestion);
|
||||
self->hop = nullptr;
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -36,7 +36,10 @@ namespace llarp
|
|||
PathContext::CheckPathLimitHitByIP(const llarp::Addr& ip)
|
||||
{
|
||||
llarp::Addr remote = ip;
|
||||
// set port to zero
|
||||
remote.port(0);
|
||||
// try inserting remote address by ip into decaying hash set
|
||||
// if it cannot insert it has hit a limit
|
||||
return not m_PathLimits.Insert(remote);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue