aboutsummaryrefslogtreecommitdiff
path: root/src/net/i2p_address.cpp
diff options
context:
space:
mode:
authorAaron Hook <ahook@protonmail.com>2020-01-18 19:18:56 -0800
committerAaron Hook <ahook@protonmail.com>2020-01-18 19:18:56 -0800
commitd0641b42fec6d32763729c93718004fba318b051 (patch)
tree3e2c5444c892be6e0e7dec9ef467faffd3205f41 /src/net/i2p_address.cpp
parentMerge pull request #6145 (diff)
downloadmonero-d0641b42fec6d32763729c93718004fba318b051.tar.xz
net: fix incorrect less operator for top/i2p addresses
Diffstat (limited to 'src/net/i2p_address.cpp')
-rw-r--r--src/net/i2p_address.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/net/i2p_address.cpp b/src/net/i2p_address.cpp
index cba829d3f..f4cc75fee 100644
--- a/src/net/i2p_address.cpp
+++ b/src/net/i2p_address.cpp
@@ -171,7 +171,8 @@ namespace net
bool i2p_address::less(const i2p_address& rhs) const noexcept
{
- return std::strcmp(host_str(), rhs.host_str()) < 0 || port() < rhs.port();
+ int res = std::strcmp(host_str(), rhs.host_str());
+ return res < 0 || (res == 0 && port() < rhs.port());
}
bool i2p_address::is_same_host(const i2p_address& rhs) const noexcept