diff options
| author | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2019-04-14 09:24:52 +0000 |
|---|---|---|
| committer | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2019-04-14 09:26:12 +0000 |
| commit | b3648232869c35963a86210d8e60464f98a1e973 (patch) | |
| tree | bf298d9751d27a47894716f80390888c3446f5c5 /src/daemon/rpc_command_executor.cpp | |
| parent | e1b097b99ba5005b9c3a0ec5a4499e3041eb8f7e (diff) | |
| download | monzero-core-b3648232869c35963a86210d8e60464f98a1e973.tar.gz monzero-core-b3648232869c35963a86210d8e60464f98a1e973.tar.xz monzero-core-b3648232869c35963a86210d8e60464f98a1e973.zip | |
daemon: fix ratio not being floating point
Coverity 197648
Diffstat (limited to 'src/daemon/rpc_command_executor.cpp')
| -rw-r--r-- | src/daemon/rpc_command_executor.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/daemon/rpc_command_executor.cpp b/src/daemon/rpc_command_executor.cpp index 5901be662..47c33b8f9 100644 --- a/src/daemon/rpc_command_executor.cpp +++ b/src/daemon/rpc_command_executor.cpp @@ -553,7 +553,7 @@ bool t_rpc_command_executor::mining_status() { if (!mining_busy && mres.active && mres.speed > 0 && mres.block_target > 0 && mres.difficulty > 0) { - double ratio = mres.speed * mres.block_target / mres.difficulty; + double ratio = mres.speed * mres.block_target / (double)mres.difficulty; uint64_t daily = 86400ull / mres.block_target * mres.block_reward * ratio; uint64_t monthly = 86400ull / mres.block_target * 30.5 * mres.block_reward * ratio; uint64_t yearly = 86400ull / mres.block_target * 356 * mres.block_reward * ratio; |
