Browse Source

Merge pull request #5441

b3648232 daemon: fix ratio not being floating point (moneromooo-monero)
e1b097b9 core_rpc_server: remove dummy assigning int to bool (moneromooo-monero)
Riccardo Spagni 2 months ago
parent
commit
8af1a89e4c
No account linked to committer's email address
2 changed files with 2 additions and 4 deletions
  1. 1
    1
      src/daemon/rpc_command_executor.cpp
  2. 1
    3
      src/rpc/core_rpc_server.cpp

+ 1
- 1
src/daemon/rpc_command_executor.cpp View File

@@ -553,7 +553,7 @@ bool t_rpc_command_executor::mining_status() {
553 553
 
554 554
   if (!mining_busy && mres.active && mres.speed > 0 && mres.block_target > 0 && mres.difficulty > 0)
555 555
   {
556
-    double ratio = mres.speed * mres.block_target / mres.difficulty;
556
+    double ratio = mres.speed * mres.block_target / (double)mres.difficulty;
557 557
     uint64_t daily = 86400ull / mres.block_target * mres.block_reward * ratio;
558 558
     uint64_t monthly = 86400ull / mres.block_target * 30.5 * mres.block_reward * ratio;
559 559
     uint64_t yearly = 86400ull / mres.block_target * 356 * mres.block_reward * ratio;

+ 1
- 3
src/rpc/core_rpc_server.cpp View File

@@ -1406,11 +1406,9 @@ namespace cryptonote
1406 1406
     submit_req.push_back(boost::value_initialized<std::string>());
1407 1407
     res.height = m_core.get_blockchain_storage().get_current_blockchain_height();
1408 1408
 
1409
-    bool r = CORE_RPC_STATUS_OK;
1410
-
1411 1409
     for(size_t i = 0; i < req.amount_of_blocks; i++)
1412 1410
     {
1413
-      r = on_getblocktemplate(template_req, template_res, error_resp, ctx);
1411
+      bool r = on_getblocktemplate(template_req, template_res, error_resp, ctx);
1414 1412
       res.status = template_res.status;
1415 1413
       template_req.prev_block.clear();
1416 1414
       

Loading…
Cancel
Save