diff options
author | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2018-09-27 18:17:32 +0000 |
---|---|---|
committer | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2018-09-27 18:17:32 +0000 |
commit | 3ebd05d4e526d884b4aa5075328d72625853a556 (patch) | |
tree | 67b08f3545af4ccc0fddb658be20050eac0c1538 | |
parent | levin_protocol_handler_async: do not propagate exception through dtor (diff) | |
download | monero-3ebd05d4e526d884b4aa5075328d72625853a556.tar.xz |
miner: restore stream flags after changing them
Coverity 136462
-rw-r--r-- | src/cryptonote_basic/miner.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/cryptonote_basic/miner.cpp b/src/cryptonote_basic/miner.cpp index 28ceee0cd..2bd43de94 100644 --- a/src/cryptonote_basic/miner.cpp +++ b/src/cryptonote_basic/miner.cpp @@ -199,8 +199,9 @@ namespace cryptonote { uint64_t total_hr = std::accumulate(m_last_hash_rates.begin(), m_last_hash_rates.end(), 0); float hr = static_cast<float>(total_hr)/static_cast<float>(m_last_hash_rates.size()); + const auto flags = std::cout.flags(); const auto precision = std::cout.precision(); - std::cout << "hashrate: " << std::setprecision(4) << std::fixed << hr << precision << ENDL; + std::cout << "hashrate: " << std::setprecision(4) << std::fixed << hr << flags << precision << ENDL; } } m_last_hr_merge_time = misc_utils::get_tick_count(); |