actually publish via far router

pull/18/head
Jeff Becker 6 years ago
parent a5143fe7a4
commit 3af93954f3
No known key found for this signature in database
GPG Key ID: F357B3B42F6F9B05

@ -44,6 +44,20 @@ namespace llarp
return out << HexEncode(self, tmp);
}
/// bitwise NOT
AlignedBuffer< sz >
operator~() const
{
AlignedBuffer< sz > ret;
size_t idx = 0;
while(idx < sz / sizeof(Long_t))
{
ret.data_l()[idx] = ~data_l()[idx];
++idx;
}
return ret;
}
bool
operator==(const AlignedBuffer& other) const
{

@ -481,11 +481,12 @@ namespace llarp
Endpoint::PublishIntroSet(llarp_router* r)
{
// publish via near router
auto path = GetEstablishedPathClosestTo(m_Identity.pub.Addr().data());
RouterID location = m_Identity.pub.Addr().data();
auto path = GetEstablishedPathClosestTo(location);
if(path && PublishIntroSetVia(r, path))
{
// publish via far router
path = PickRandomEstablishedPath();
path = GetEstablishedPathClosestTo(~location);
return path && PublishIntroSetVia(r, path);
}
return false;

Loading…
Cancel
Save