aboutsummaryrefslogtreecommitdiff
path: root/src/daemon
diff options
context:
space:
mode:
authormoneromooo-monero <moneromooo-monero@users.noreply.github.com>2015-11-26 00:25:13 +0000
committermoneromooo-monero <moneromooo-monero@users.noreply.github.com>2015-11-26 00:25:13 +0000
commit55e5a33d85d7a955a4468778279064b209e36af4 (patch)
treee01c202a40db9fc4946cf27a3aa5169e31e527c5 /src/daemon
parentMerge pull request #501 (diff)
downloadmonero-55e5a33d85d7a955a4468778279064b209e36af4.tar.xz
rpc: pass current block target in rpc
This fixes the hash rate being wrong on testnet after the switch to 2 minute blocks
Diffstat (limited to 'src/daemon')
-rw-r--r--src/daemon/rpc_command_executor.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/daemon/rpc_command_executor.cpp b/src/daemon/rpc_command_executor.cpp
index 176df81fc..b9ed98349 100644
--- a/src/daemon/rpc_command_executor.cpp
+++ b/src/daemon/rpc_command_executor.cpp
@@ -242,7 +242,7 @@ bool t_rpc_command_executor::show_difficulty() {
tools::success_msg_writer() << "BH: " << res.height
<< ", DIFF: " << res.difficulty
- << ", HR: " << (int) res.difficulty / 60L << " H/s";
+ << ", HR: " << (int) res.difficulty / res.target << " H/s";
return true;
}
@@ -287,7 +287,7 @@ bool t_rpc_command_executor::show_status() {
% (100.0f * ires.height / (ires.target_height ? ires.target_height < ires.height ? ires.height : ires.target_height : ires.height))
% (ires.testnet ? "testnet" : "mainnet")
% [&ires]()->std::string {
- float hr = ires.difficulty / 60.0f;
+ float hr = ires.difficulty / ires.target;
if (hr>1e9) return (boost::format("%.2f GH/s") % (hr/1e9)).str();
if (hr>1e6) return (boost::format("%.2f MH/s") % (hr/1e6)).str();
if (hr>1e3) return (boost::format("%.2f kH/s") % (hr/1e3)).str();