Add sorting by protocol to get_peers function

-Small change to help sort the peers list a bit better when filtering ports so that lower protocols drop off the list if there are multiple connections from the same ip with different protocols
This commit is contained in:
Joe Uhren
2022-09-22 16:54:56 -06:00
parent 7bbd8d80b4
commit 6078cd8733
+1 -1
View File
@@ -1125,7 +1125,7 @@ module.exports = {
},
get_peers: function(cb) {
Peers.find().sort({address: 1, port: 1}).exec(function (err, peers) {
Peers.find().sort({address: 1, protocol: -1, port: 1}).exec(function (err, peers) {
if (err)
return cb([]);
else