This commit is contained in:
Adam Ierymenko 2019-08-30 09:38:18 -07:00
parent 795b6d13d1
commit 7d89511fda
No known key found for this signature in database
GPG Key ID: C8877CF2D7A5D7F3

View File

@ -736,8 +736,13 @@ int main(int argc,char **argv)
std::ostringstream o;
o << '[';
{
bool first = true;
std::lock_guard<std::mutex> l(peersByIdentity_l);
for(auto p=peersByIdentity.begin();p!=peersByIdentity.end();++p) {
if (first) {
first = false;
o << ',';
}
o <<
"{\"address\":\"" << p->first.address().toString(tmp) << "\""
",\"latency\":-1"
@ -753,6 +758,8 @@ int main(int argc,char **argv)
",\"trustedPathId\":0}";
}
if (p->second->ip6) {
if (p->second->ip4)
o << ',';
o <<
"{\"active\":true"
",\"address\":\"" << p->second->ip6.toIpString(tmp) << "\\/" << p->second->ip6.port() << "\""