Show pool-side hashrate in status only when it's not zero

This commit is contained in:
SChernykh 2021-09-05 15:56:50 +02:00
parent 83c35e5c87
commit dd0a35fb79
2 changed files with 8 additions and 2 deletions

View file

@ -299,15 +299,21 @@ template<> struct log::Stream::Entry<std::string>
struct Hashrate
{
explicit FORCEINLINE Hashrate(uint64_t data) : m_data(data) {}
FORCEINLINE Hashrate() : m_data(0), m_valid(false) {}
explicit FORCEINLINE Hashrate(uint64_t data) : m_data(data), m_valid(true) {}
uint64_t m_data;
bool m_valid;
};
template<> struct log::Stream::Entry<Hashrate>
{
static NOINLINE void put(Hashrate&& value, Stream* wrapper)
{
if (!value.m_valid) {
return;
}
const double x = static_cast<double>(value.m_data);
static constexpr const char* units[] = { "H/s", "KH/s", "MH/s", "GH/s", "TH/s", "PH/s", "EH/s" };

View file

@ -651,7 +651,7 @@ void SideChain::print_status()
"\nMain chain hashrate = " << log::Hashrate(network_hashrate) <<
"\nSide chain height = " << tip_height + 1 <<
"\nSide chain hashrate = " << log::Hashrate(pool_hashrate) <<
"\nYour hashrate (pool-side) = " << log::Hashrate(hashrate_est) <<
(hashrate_est ? "\nYour hashrate (pool-side) = " : "") << (hashrate_est ? log::Hashrate(hashrate_est) : log::Hashrate()) <<
"\nPPLNS window = " << total_blocks_in_window << " blocks (+" << total_uncles_in_window << " uncles, " << total_orphans << " orphans)"
"\nYour shares = " << our_blocks_in_window << " blocks (+" << our_uncles_in_window << " uncles, " << our_orphans << " orphans)"
"\nBlock reward share (est) = " << log::XMRAmount(reward_share)