Skip to content

Commit

Permalink
daemon: fix ratio not being floating point
Browse files Browse the repository at this point in the history
Coverity 197648
  • Loading branch information
moneromooo-monero committed Apr 14, 2019
1 parent e1b097b commit b364823
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/daemon/rpc_command_executor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit b364823

Please sign in to comment.