diff options
| author | jeffro256 <jeffro256@tutanota.com> | 2024-08-23 12:15:17 -0500 |
|---|---|---|
| committer | jeffro256 <jeffro256@tutanota.com> | 2024-09-10 16:07:36 -0500 |
| commit | 65568d3a884857ce08d1170f5801a6891a5c187c (patch) | |
| tree | e0685979542aed3ec92b2fe828be15b4ead7564f /src/cryptonote_protocol/block_queue.cpp | |
| parent | b089f9ee69924882c5d14dd1a6991deb05d9d1cd (diff) | |
| download | monzero-core-65568d3a884857ce08d1170f5801a6891a5c187c.tar.gz monzero-core-65568d3a884857ce08d1170f5801a6891a5c187c.tar.xz monzero-core-65568d3a884857ce08d1170f5801a6891a5c187c.zip | |
build: fix build with Boost 1.85 and remove instances of viewkey logging [RELEASE]
1. Use std::is_standard_layout and std::is_trivially_copyable instead of std::is_pod for KV byte-wise serialization, which fixes compile issue for Boost UUIDs
2. Removed reimplementation of std::hash for boost::uuids::uuid
3. Removed << operator overload for crypto::secret_key
4. Removed instances in code where private view key was dumped to the log in plaintext
Release version of #9450, containing C++14 modified assertions
Diffstat (limited to 'src/cryptonote_protocol/block_queue.cpp')
| -rw-r--r-- | src/cryptonote_protocol/block_queue.cpp | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/src/cryptonote_protocol/block_queue.cpp b/src/cryptonote_protocol/block_queue.cpp index 4e65eafa4..e5a4c0c99 100644 --- a/src/cryptonote_protocol/block_queue.cpp +++ b/src/cryptonote_protocol/block_queue.cpp @@ -40,15 +40,6 @@ #undef MONERO_DEFAULT_LOG_CATEGORY #define MONERO_DEFAULT_LOG_CATEGORY "cn.block_queue" -namespace std { - static_assert(sizeof(size_t) <= sizeof(boost::uuids::uuid), "boost::uuids::uuid too small"); - template<> struct hash<boost::uuids::uuid> { - std::size_t operator()(const boost::uuids::uuid &_v) const { - return reinterpret_cast<const std::size_t &>(_v); - } - }; -} - namespace cryptonote { @@ -472,7 +463,7 @@ bool block_queue::has_spans(const boost::uuids::uuid &connection_id) const float block_queue::get_speed(const boost::uuids::uuid &connection_id) const { boost::unique_lock<boost::recursive_mutex> lock(mutex); - std::unordered_map<boost::uuids::uuid, float> speeds; + std::unordered_map<boost::uuids::uuid, float, boost::hash<boost::uuids::uuid>> speeds; for (const auto &span: blocks) { if (span.blocks.empty()) @@ -480,7 +471,7 @@ float block_queue::get_speed(const boost::uuids::uuid &connection_id) const // note that the average below does not average over the whole set, but over the // previous pseudo average and the latest rate: this gives much more importance // to the latest measurements, which is fine here - std::unordered_map<boost::uuids::uuid, float>::iterator i = speeds.find(span.connection_id); + const auto i = speeds.find(span.connection_id); if (i == speeds.end()) speeds.insert(std::make_pair(span.connection_id, span.rate)); else |
