update rpc mining_status

This commit is contained in:
wowario 2019-06-02 09:10:16 +03:00
parent 3b9a06d5aa
commit c7b73d31a5
No known key found for this signature in database
GPG key ID: 24DCBE762DE9C111

View file

@ -1005,14 +1005,14 @@ namespace cryptonote
const account_public_address& lMiningAdr = lMiner.get_mining_address();
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;
const unsigned variant = major_version >= 13 ? 6 : major_version >= 11 && major_version <= 12 ? 4 : 2;
switch (variant)
{
case 0: res.pow_algorithm = "Cryptonight"; break;
case 1: res.pow_algorithm = "CNv1 (Cryptonight variant 1)"; break;
case 2: case 3: res.pow_algorithm = "CNv2 (Cryptonight variant 2)"; break;
case 4: case 5: res.pow_algorithm = "CNv4 (Cryptonight variant 4)"; break;
case 6: res.pow_algorithm = "RandomX"; break;
case 4: case 5: res.pow_algorithm = "CN/WOW"; break;
case 6: res.pow_algorithm = "RandomWOW"; break;
default: res.pow_algorithm = "I'm not sure actually"; break;
}
if (res.is_background_mining_enabled)