Merge pull request #5872

495a7e5 rpc: don't include an address in mining_status when not mining (moneromooo-monero)
This commit is contained in:
luigi1111 2019-09-14 13:16:45 -05:00
commit 85962ee8e2
No known key found for this signature in database
GPG Key ID: F4ACA0183641E010

View File

@ -1050,7 +1050,8 @@ 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();
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 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;
switch (variant) switch (variant)