You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
lokinet/llarp/service/router_lookup_job.hpp

36 lines
632 B
C++

#pragma once
#include <llarp/router_contact.hpp>
namespace llarp
{
namespace service
{
struct Endpoint;
struct RouterLookupJob
{
RouterLookupJob(Endpoint* p, RouterLookupHandler h);
RouterLookupHandler handler;
uint64_t txid;
llarp_time_t started;
bool
IsExpired(llarp_time_t now) const
{
if (now < started)
return false;
return now - started > 30s;
}
void
InformResult(std::vector<RouterContact> result)
{
if (handler)
handler(result);
}
};
} // namespace service
} // namespace llarp