lokinet/llarp/dht/node.hpp
dr7ana 7f8207d5d3 Nuked superfluous interface classes
RIP:
- i_link_manager
- i_outbound_message_handler
- i_gossiper
- i_outbound_session_maker
- i_rc_lookup_handler
2023-09-13 13:34:34 -07:00

65 lines
1.0 KiB
C++

#pragma once
#include "key.hpp"
#include <llarp/router_contact.hpp>
#include <llarp/service/intro_set.hpp>
#include <utility>
namespace llarp::dht
{
struct RCNode
{
RouterContact rc;
Key_t ID;
RCNode()
{
ID.Zero();
}
RCNode(const RouterContact& other) : rc(other), ID(other.pubkey)
{}
util::StatusObject
ExtractStatus() const
{
return rc.ExtractStatus();
}
bool
operator<(const RCNode& other) const
{
return rc.last_updated < other.rc.last_updated;
}
};
struct ISNode
{
service::EncryptedIntroSet introset;
Key_t ID;
ISNode()
{
ID.Zero();
}
ISNode(service::EncryptedIntroSet other) : introset(std::move(other))
{
ID = Key_t(introset.derivedSigningKey.as_array());
}
util::StatusObject
ExtractStatus() const
{
return introset.ExtractStatus();
}
bool
operator<(const ISNode& other) const
{
return introset.signedAt < other.introset.signedAt;
}
};
} // namespace llarp::dht