From 6078cd87334e62762a95b03ad15f3a9af8b71cb5 Mon Sep 17 00:00:00 2001 From: Joe Uhren Date: Thu, 22 Sep 2022 16:54:56 -0600 Subject: [PATCH] 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 --- lib/database.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/database.js b/lib/database.js index 6fd14b1..d664ef7 100644 --- a/lib/database.js +++ b/lib/database.js @@ -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