From f934b81703eedbc152f07a90a179847f9cc3caea Mon Sep 17 00:00:00 2001 From: Adam Ierymenko Date: Fri, 12 Jul 2013 16:40:59 -0400 Subject: Several bug fixes in newly refactored code. --- node/Multicaster.hpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'node/Multicaster.hpp') 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

()); + std::sort(toConsider,toConsider + sampleSize,PeerPropagationPrioritySortOrder

()); // 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()); } }; -- cgit v1.2.3