telehash/e3x-js

best path logic error

alanz opened this issue · 0 comments

https://github.com/telehash/thjs/blob/master/thjs.js#L872

      alive.push(packet.sender);
      var best = packet.sender;
      alive.forEach(function(path){
        if(pathShareOrder.indexOf(path.type) > pathShareOrder.indexOf(path.type)) return;
        if(isLocalPath(best)) return; // always prefer (the first) local paths
        best = path;
      });

I am pretty sure the > should be comparing best with path, not path with path