diff options
author | Aaron Hook <ahook@protonmail.com> | 2020-01-18 19:18:56 -0800 |
---|---|---|
committer | Aaron Hook <ahook@protonmail.com> | 2020-01-18 19:18:56 -0800 |
commit | d0641b42fec6d32763729c93718004fba318b051 (patch) | |
tree | 3e2c5444c892be6e0e7dec9ef467faffd3205f41 /src/net/tor_address.cpp | |
parent | Merge pull request #6145 (diff) | |
download | monero-d0641b42fec6d32763729c93718004fba318b051.tar.xz |
net: fix incorrect less operator for top/i2p addresses
Diffstat (limited to 'src/net/tor_address.cpp')
-rw-r--r-- | src/net/tor_address.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/net/tor_address.cpp b/src/net/tor_address.cpp index 904a9a0fc..4414861e7 100644 --- a/src/net/tor_address.cpp +++ b/src/net/tor_address.cpp @@ -173,7 +173,8 @@ namespace net bool tor_address::less(const tor_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 tor_address::is_same_host(const tor_address& rhs) const noexcept |