aboutsummaryrefslogtreecommitdiff
path: root/src/rpc/core_rpc_server.cpp
diff options
context:
space:
mode:
authormoneromooo-monero <moneromooo-monero@users.noreply.github.com>2019-05-27 14:14:11 +0000
committermoneromooo-monero <moneromooo-monero@users.noreply.github.com>2019-08-28 16:02:37 +0000
commit495a7e5b97b3795ac598e699a659f50ec0d9a313 (patch)
tree7b7aec6d36a930bc332f66374944a40323e78269 /src/rpc/core_rpc_server.cpp
parentMerge pull request #5707 (diff)
downloadmonero-495a7e5b97b3795ac598e699a659f50ec0d9a313.tar.xz
rpc: don't include an address in mining_status when not mining
Best case is an address mined previously and it'll get returned, worst case it was never initialized in the first place
Diffstat (limited to 'src/rpc/core_rpc_server.cpp')
-rw-r--r--src/rpc/core_rpc_server.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/rpc/core_rpc_server.cpp b/src/rpc/core_rpc_server.cpp
index 1fc4b816f..ce359aae6 100644
--- a/src/rpc/core_rpc_server.cpp
+++ b/src/rpc/core_rpc_server.cpp
@@ -1004,7 +1004,8 @@ namespace cryptonote
res.block_reward = lMiner.get_block_reward();
}
const account_public_address& lMiningAdr = lMiner.get_mining_address();
- res.address = get_account_address_as_str(nettype(), false, lMiningAdr);
+ if (lMiner.is_mining() || lMiner.get_is_background_mining_enabled())
+ res.address = get_account_address_as_str(nettype(), false, lMiningAdr);
const uint8_t major_version = m_core.get_blockchain_storage().get_current_hard_fork_version();
const unsigned variant = major_version >= 7 ? major_version - 6 : 0;
switch (variant)