Use ToString over ToHex

pull/780/head
Michael 5 years ago
parent afb94381a2
commit 777261cb20
No known key found for this signature in database
GPG Key ID: 2D51757B47E2434C

@ -30,7 +30,7 @@ namespace llarp
util::StatusObject obj{};
for(const auto& item : nodes)
{
obj[item.first.ToHex()] = item.second.ExtractStatus();
obj[item.first.ToString()] = item.second.ExtractStatus();
}
return obj;
}

@ -37,6 +37,12 @@ namespace llarp
return rid.ToString();
}
std::string
ToString() const
{
return SNode();
}
Key_t
operator^(const Key_t& other) const
{

@ -42,7 +42,7 @@ namespace llarp
ExtractStatus() const
{
util::StatusObject obj{{"whoasked", whoasked.ExtractStatus()},
{"target", target.ToHex()}};
{"target", target.ToString()}};
std::vector< util::StatusObject > foundObjs;
std::transform(valuesFound.begin(), valuesFound.end(),
std::back_inserter(foundObjs),
@ -54,7 +54,7 @@ namespace llarp
std::vector< std::string > asked;
std::transform(
peersAsked.begin(), peersAsked.end(), std::back_inserter(asked),
[](const auto& item) -> std::string { return item.ToHex(); });
[](const auto& item) -> std::string { return item.ToString(); });
obj["asked"] = asked;
return obj;
}

@ -45,14 +45,14 @@ namespace llarp
timeouts.begin(), timeouts.end(), std::back_inserter(timeoutsObjs),
[](const auto& item) -> util::StatusObject {
return util::StatusObject{{"time", item.second},
{"target", item.first.ToHex()}};
{"target", item.first.ToString()}};
});
obj["timeouts"] = timeoutsObjs;
std::transform(waiting.begin(), waiting.end(),
std::back_inserter(waitingObjs),
[](const auto& item) -> util::StatusObject {
return util::StatusObject{
{"target", item.first.ToHex()},
{"target", item.first.ToString()},
{"whoasked", item.second.ExtractStatus()}};
});
obj["waiting"] = waitingObjs;

@ -163,7 +163,7 @@ namespace llarp
util::StatusObject obj{{"lastUpdated", last_updated},
{"exit", IsExit()},
{"publicRouter", IsPublicRouter()},
{"identity", pubkey.ToHex()}};
{"identity", pubkey.ToString()}};
if(HasNick())
obj["nickname"] = Nick();
return obj;

Loading…
Cancel
Save