This commit is contained in:
Adam Ierymenko 2019-09-26 09:34:31 -07:00
parent 5175636d36
commit 7061f13b24
No known key found for this signature in database
GPG key ID: C8877CF2D7A5D7F3
10 changed files with 229 additions and 43 deletions

View file

@ -537,6 +537,7 @@ ZT_PeerList *Node::peers() const
p->latency = -1;
p->role = RR->topology->isRoot((*pi)->identity()) ? ZT_PEER_ROLE_PLANET : ZT_PEER_ROLE_LEAF;
const int64_t now = _now;
std::vector< SharedPtr<Path> > paths((*pi)->paths(_now));
SharedPtr<Path> bestp((*pi)->getAppropriatePath(_now,false));
p->hadAggregateLink |= (*pi)->hasAggregateLink();
@ -546,7 +547,7 @@ ZT_PeerList *Node::peers() const
p->paths[p->pathCount].lastSend = (*path)->lastOut();
p->paths[p->pathCount].lastReceive = (*path)->lastIn();
p->paths[p->pathCount].trustedPathId = RR->topology->getOutboundPathTrust((*path)->address());
p->paths[p->pathCount].expired = 0;
p->paths[p->pathCount].alive = (*path)->alive(now) ? 1 : 0;
p->paths[p->pathCount].preferred = ((*path) == bestp) ? 1 : 0;
p->paths[p->pathCount].latency = (float)(*path)->latency();
p->paths[p->pathCount].packetDelayVariance = (*path)->packetDelayVariance();