summaryrefslogtreecommitdiff
path: root/node/Multicaster.hpp
diff options
context:
space:
mode:
authorAdam Ierymenko <adam.ierymenko@gmail.com>2013-07-12 16:40:59 -0400
committerAdam Ierymenko <adam.ierymenko@gmail.com>2013-07-12 16:40:59 -0400
commitf934b81703eedbc152f07a90a179847f9cc3caea (patch)
tree94692e9447873fa469981ede977ed20e9b32b140 /node/Multicaster.hpp
parenta86e1cdb8874d88c8c84543379ad5552c8ce8701 (diff)
downloadinfinitytier-f934b81703eedbc152f07a90a179847f9cc3caea.tar.gz
infinitytier-f934b81703eedbc152f07a90a179847f9cc3caea.zip
Several bug fixes in newly refactored code.
Diffstat (limited to 'node/Multicaster.hpp')
-rw-r--r--node/Multicaster.hpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/node/Multicaster.hpp b/node/Multicaster.hpp
index daa53358..d9d12607 100644
--- a/node/Multicaster.hpp
+++ b/node/Multicaster.hpp
@@ -266,7 +266,7 @@ public:
// Sort in descending order of most recent direct unicast frame, picking
// peers with whom we have recently communicated. This is "implicit social
// switching."
- std::sort(&(toConsider[0]),&(toConsider[sampleSize]),PeerPropagationPrioritySortOrder<P>());
+ std::sort(toConsider,toConsider + sampleSize,PeerPropagationPrioritySortOrder<P>());
// Decay a few random bits in bloom filter to probabilistically eliminate
// false positives as we go. The odds of decaying an already-set bit
@@ -290,7 +290,10 @@ public:
// LIKEs and so can act to bridge sparse multicast groups. We do not remember them
// in the bloom filter.
if (!picked) {
- P peer = topology.getBestSupernode();
+ Address avoid[2];
+ avoid[0] = upstream;
+ avoid[1] = originalSubmitter;
+ P peer = topology.getBestSupernode(avoid,2,true);
if (peer)
peers[picked++] = peer;
}
@@ -305,7 +308,7 @@ private:
{
inline bool operator()(const P &p1,const P &p2) const
{
- return (p1->lastUnicastFrame() >= p2->lastUnicastFrame());
+ return (p1->lastUnicastFrame() > p2->lastUnicastFrame());
}
};