mirror of
https://github.com/oxen-io/lokinet.git
synced 2024-11-17 15:25:35 +00:00
51 lines
954 B
C++
51 lines
954 B
C++
#include <tooling/router_event.hpp>
|
|
|
|
#include <tooling/router_hive.hpp>
|
|
|
|
#include <path/path.hpp>
|
|
|
|
namespace tooling
|
|
{
|
|
|
|
RouterEvent::RouterEvent(llarp::RouterID routerID)
|
|
: routerID(routerID)
|
|
{
|
|
}
|
|
|
|
PathBuildAttemptEvent::PathBuildAttemptEvent(const llarp::RouterID& routerID, std::vector<llarp::path::PathHopConfig> hops)
|
|
: RouterEvent(routerID), hops(hops)
|
|
{
|
|
}
|
|
|
|
void
|
|
PathBuildAttemptEvent::Process(RouterHive& hive) const
|
|
{
|
|
hive.ProcessPathBuildAttempt(*this);
|
|
}
|
|
|
|
std::string
|
|
PathBuildAttemptEvent::ToString() const
|
|
{
|
|
std::string result = "PathBuildAttemptEvent [";
|
|
result += routerID.ToString().substr(0, 8);
|
|
result += "] ---- [";
|
|
|
|
size_t i = 0;
|
|
for (const auto& hop : hops)
|
|
{
|
|
i++;
|
|
|
|
result += hop.rc.pubkey.ToString().substr(0, 8);
|
|
result += "]";
|
|
|
|
if (i != hops.size())
|
|
{
|
|
result += " -> [";
|
|
}
|
|
}
|
|
|
|
return result;
|
|
}
|
|
|
|
} // namespace tooling
|