diff --git a/nano/lib/numbers.cpp b/nano/lib/numbers.cpp index 47d92a8c7..eccd11577 100644 --- a/nano/lib/numbers.cpp +++ b/nano/lib/numbers.cpp @@ -150,11 +150,6 @@ nano::uint256_union::uint256_union (nano::uint256_t const & number_a) boost::multiprecision::export_bits (number_a, bytes.rbegin (), 8, false); } -bool nano::uint256_union::operator== (nano::uint256_union const & other_a) const -{ - return bytes == other_a.bytes; -} - // Construct a uint256_union = AES_ENC_CTR (cleartext, key, iv) void nano::uint256_union::encrypt (nano::raw_key const & cleartext, nano::raw_key const & key, uint128_union const & iv) { @@ -175,11 +170,6 @@ std::string nano::uint256_union::to_string () const return result; } -bool nano::uint256_union::operator< (nano::uint256_union const & other_a) const -{ - return std::memcmp (bytes.data (), other_a.bytes.data (), 32) < 0; -} - nano::uint256_union & nano::uint256_union::operator^= (nano::uint256_union const & other_a) { auto j (other_a.qwords.begin ()); @@ -297,11 +287,6 @@ nano::uint256_union::uint256_union (uint64_t value0) *this = nano::uint256_t (value0); } -bool nano::uint256_union::operator!= (nano::uint256_union const & other_a) const -{ - return !(*this == other_a); -} - bool nano::uint512_union::operator== (nano::uint512_union const & other_a) const { return bytes == other_a.bytes; diff --git a/nano/lib/numbers.hpp b/nano/lib/numbers.hpp index 6dbfaa3b5..f82ca3aa3 100644 --- a/nano/lib/numbers.hpp +++ b/nano/lib/numbers.hpp @@ -75,9 +75,6 @@ public: void encrypt (nano::raw_key const &, nano::raw_key const &, uint128_union const &); uint256_union & operator^= (nano::uint256_union const &); uint256_union operator^ (nano::uint256_union const &) const; - bool operator== (nano::uint256_union const &) const; - bool operator!= (nano::uint256_union const &) const; - bool operator< (nano::uint256_union const &) const; void encode_hex (std::string &) const; bool decode_hex (std::string const &); void encode_dec (std::string &) const; @@ -97,6 +94,18 @@ public: std::array owords; }; }; +inline bool operator== (nano::uint256_union const & lhs, nano::uint256_union const & rhs) +{ + return lhs.bytes == rhs.bytes; +} +inline bool operator!= (nano::uint256_union const & lhs, nano::uint256_union const & rhs) +{ + return !(lhs == rhs); +} +inline bool operator< (nano::uint256_union const & lhs, nano::uint256_union const & rhs) +{ + return std::memcmp (lhs.bytes.data (), rhs.bytes.data (), 32) < 0; +} static_assert (std::is_nothrow_move_constructible::value, "uint256_union should be noexcept MoveConstructible"); class link; @@ -133,8 +142,6 @@ public: operator nano::hash_or_account const & () const; bool operator== (std::nullptr_t) const; bool operator!= (std::nullptr_t) const; - using uint256_union::operator==; - using uint256_union::operator!=; }; class wallet_id : public uint256_union diff --git a/nano/node/bootstrap/bootstrap_connections.cpp b/nano/node/bootstrap/bootstrap_connections.cpp index 21f349aaf..7e1075c9a 100644 --- a/nano/node/bootstrap/bootstrap_connections.cpp +++ b/nano/node/bootstrap/bootstrap_connections.cpp @@ -406,7 +406,7 @@ void nano::bootstrap_connections::requeue_pull (nano::pull_info const & pull_a, } else if (lazy && (pull.attempts <= pull.retry_limit + (pull.processed / node.network_params.bootstrap.lazy_max_pull_blocks))) { - debug_assert (pull.account_or_head == pull.head); + debug_assert (pull.account_or_head.as_block_hash () == pull.head); if (!lazy->lazy_processed_or_exists (pull.account_or_head.as_block_hash ())) { { diff --git a/nano/node/bootstrap/bootstrap_lazy.cpp b/nano/node/bootstrap/bootstrap_lazy.cpp index ac73270a6..7bc5e5d19 100644 --- a/nano/node/bootstrap/bootstrap_lazy.cpp +++ b/nano/node/bootstrap/bootstrap_lazy.cpp @@ -53,7 +53,7 @@ void nano::bootstrap_attempt_lazy::lazy_add (nano::hash_or_account const & hash_ void nano::bootstrap_attempt_lazy::lazy_add (nano::pull_info const & pull_a) { - debug_assert (pull_a.account_or_head == pull_a.head); + debug_assert (pull_a.account_or_head.as_block_hash () == pull_a.head); nano::lock_guard lock{ mutex }; lazy_add (pull_a.account_or_head, pull_a.retry_limit); }