summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam Ierymenko <adam.ierymenko@gmail.com>2017-04-17 10:12:13 -0700
committerAdam Ierymenko <adam.ierymenko@gmail.com>2017-04-17 10:12:13 -0700
commit95e5345cc37316c264c8d3d732d324c60f18ab72 (patch)
treebed700e6be318bb68eceda2c61396db999068e91
parentba5d0cc2f91310bb5e395c241a21aad7e5ab88fa (diff)
downloadinfinitytier-95e5345cc37316c264c8d3d732d324c60f18ab72.tar.gz
infinitytier-95e5345cc37316c264c8d3d732d324c60f18ab72.zip
Cluster build fix.
-rw-r--r--node/Peer.cpp2
-rw-r--r--node/Peer.hpp7
2 files changed, 3 insertions, 6 deletions
diff --git a/node/Peer.cpp b/node/Peer.cpp
index 827dc7de..2e9f6a2b 100644
--- a/node/Peer.cpp
+++ b/node/Peer.cpp
@@ -109,7 +109,7 @@ void Peer::received(
outp.armor(_key,true,path->nextOutgoingCounter());
path->send(RR,tPtr,outp.data(),outp.size(),now);
}
- suboptimalPath = true;
+ isClusterSuboptimalPath = true;
}
}
#endif
diff --git a/node/Peer.hpp b/node/Peer.hpp
index 6cf30feb..b9d85404 100644
--- a/node/Peer.hpp
+++ b/node/Peer.hpp
@@ -316,11 +316,8 @@ public:
*/
inline bool hasLocalClusterOptimalPath(uint64_t now) const
{
- for(unsigned int p=0,np=_numPaths;p<np;++p) {
- if ( (_paths[p].path->alive(now)) && (!_paths[p].localClusterSuboptimal) )
- return true;
- }
- return false;
+ Mutex::Lock _l(_paths_m);
+ return ( ((_v4Path.p)&&(_v4Path.p->alive(now))&&(!_v4Path.localClusterSuboptimal)) || ((_v6Path.p)&&(_v6Path.p->alive(now))&&(!_v6Path.localClusterSuboptimal)) );
}
#endif