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
This commit is contained in:
moneromooo-monero 2019-05-27 14:14:11 +00:00
parent 85014813cf
commit 495a7e5b97
No known key found for this signature in database
GPG Key ID: 686F07454D6CEFC3
1 changed files with 2 additions and 1 deletions

View File

@ -1004,6 +1004,7 @@ namespace cryptonote
res.block_reward = lMiner.get_block_reward(); res.block_reward = lMiner.get_block_reward();
} }
const account_public_address& lMiningAdr = lMiner.get_mining_address(); const account_public_address& lMiningAdr = lMiner.get_mining_address();
if (lMiner.is_mining() || lMiner.get_is_background_mining_enabled())
res.address = get_account_address_as_str(nettype(), false, lMiningAdr); 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 uint8_t major_version = m_core.get_blockchain_storage().get_current_hard_fork_version();
const unsigned variant = major_version >= 7 ? major_version - 6 : 0; const unsigned variant = major_version >= 7 ? major_version - 6 : 0;