lokinet/llarp/service/lookup.cpp

26 lines
601 B
C++
Raw Normal View History

2018-07-18 03:10:21 +00:00
#include <llarp/path.hpp>
2018-08-04 02:59:32 +00:00
#include <llarp/service/endpoint.hpp>
2018-07-18 03:10:21 +00:00
#include <llarp/service/lookup.hpp>
2018-08-04 02:59:32 +00:00
2018-07-18 03:10:21 +00:00
namespace llarp
{
namespace service
{
2018-08-04 02:59:32 +00:00
IServiceLookup::IServiceLookup(ILookupHolder *p, uint64_t tx)
: parent(p), txid(tx)
{
p->PutLookup(this, tx);
}
2018-07-18 03:10:21 +00:00
bool
IServiceLookup::SendRequestViaPath(llarp::path::Path *path, llarp_router *r)
{
auto msg = BuildRequestMessage();
if(!msg)
return false;
auto result = path->SendRoutingMessage(msg, r);
delete msg;
return result;
}
} // namespace service
} // namespace llarp