mirror of https://github.com/oxen-io/lokinet
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.
47 lines
901 B
C++
47 lines
901 B
C++
#include <tooling/router_event.hpp>
|
|
|
|
#include <tooling/router_hive.hpp>
|
|
|
|
#include <llarp/router_id.hpp>
|
|
#include <llarp/path/path.hpp>
|
|
|
|
namespace tooling
|
|
{
|
|
|
|
PathBuildAttemptEvent::PathBuildAttemptEvent(const llarp::RouterID& routerID, std::vector<llarp::path::PathHopConfig> hops)
|
|
: routerID(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
|