mirror of
https://github.com/oxen-io/lokinet.git
synced 2024-11-02 03:40:12 +00:00
273270916e
This commit reflects changes to clang-format rules. Unfortunately, these rule changes create a massive change to the codebase, which causes an apparent rewrite of git history. Git blame's --ignore-rev flag can be used to ignore this commit when attempting to `git blame` some code.
38 lines
708 B
C++
38 lines
708 B
C++
#ifndef LLARP_SERVICE_ROUTER_LOOKUP_JOB_HPP
|
|
#define LLARP_SERVICE_ROUTER_LOOKUP_JOB_HPP
|
|
|
|
#include <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
|
|
#endif
|