|
|
@ -23,8 +23,8 @@ namespace llarp
|
|
|
|
namespace path
|
|
|
|
namespace path
|
|
|
|
{
|
|
|
|
{
|
|
|
|
Path::Path(const std::vector< RouterContact >& h, PathSet* parent,
|
|
|
|
Path::Path(const std::vector< RouterContact >& h, PathSet* parent,
|
|
|
|
PathRole startingRoles)
|
|
|
|
PathRole startingRoles, std::string shortName)
|
|
|
|
: m_PathSet(parent), _role(startingRoles)
|
|
|
|
: m_PathSet(parent), _role(startingRoles), m_shortName(std::move(shortName))
|
|
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
{
|
|
|
|
hops.resize(h.size());
|
|
|
|
hops.resize(h.size());
|
|
|
@ -122,6 +122,12 @@ namespace llarp
|
|
|
|
return hops[0].rc.pubkey;
|
|
|
|
return hops[0].rc.pubkey;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const std::string&
|
|
|
|
|
|
|
|
Path::ShortName() const
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
return m_shortName;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
std::string
|
|
|
|
std::string
|
|
|
|
Path::HopsString() const
|
|
|
|
Path::HopsString() const
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -354,7 +360,7 @@ namespace llarp
|
|
|
|
std::vector< RouterContact > newHops;
|
|
|
|
std::vector< RouterContact > newHops;
|
|
|
|
for(const auto& hop : hops)
|
|
|
|
for(const auto& hop : hops)
|
|
|
|
newHops.emplace_back(hop.rc);
|
|
|
|
newHops.emplace_back(hop.rc);
|
|
|
|
LogInfo(Name(), " rebuilding on ", HopsString());
|
|
|
|
LogInfo(Name(), " rebuilding on ", ShortName());
|
|
|
|
m_PathSet->Build(newHops);
|
|
|
|
m_PathSet->Build(newHops);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -639,7 +645,7 @@ namespace llarp
|
|
|
|
bool
|
|
|
|
bool
|
|
|
|
Path::HandlePathConfirmMessage(AbstractRouter* r)
|
|
|
|
Path::HandlePathConfirmMessage(AbstractRouter* r)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
LogDebug("Path Build Confirm, path: ", HopsString());
|
|
|
|
LogDebug("Path Build Confirm, path: ", ShortName());
|
|
|
|
const auto now = llarp::time_now_ms();
|
|
|
|
const auto now = llarp::time_now_ms();
|
|
|
|
if(_status == ePathBuilding)
|
|
|
|
if(_status == ePathBuilding)
|
|
|
|
{
|
|
|
|
{
|
|
|
|