From a04690c66bf5d09517055a2f0d1c6cf6ec43223a Mon Sep 17 00:00:00 2001 From: wowario Date: Tue, 31 Jan 2023 10:24:03 +0300 Subject: [PATCH] set pow variants --- src/cryptonote_core/cryptonote_tx_utils.cpp | 2 +- src/rpc/core_rpc_server.cpp | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/cryptonote_core/cryptonote_tx_utils.cpp b/src/cryptonote_core/cryptonote_tx_utils.cpp index 5058b89a9..1583b3c5a 100644 --- a/src/cryptonote_core/cryptonote_tx_utils.cpp +++ b/src/cryptonote_core/cryptonote_tx_utils.cpp @@ -699,7 +699,7 @@ namespace cryptonote } rx_slow_hash(hash.data, bd.data(), bd.size(), res.data); } else { - const int pow_variant = major_version >= 7 ? major_version - 6 : 0; + const int pow_variant = major_version >= 11 ? 4 : major_version >= 9 ? 2 : 1; crypto::cn_slow_hash(bd.data(), bd.size(), res, pow_variant, height); } return true; diff --git a/src/rpc/core_rpc_server.cpp b/src/rpc/core_rpc_server.cpp index 35c0d2a9c..abd23c49c 100644 --- a/src/rpc/core_rpc_server.cpp +++ b/src/rpc/core_rpc_server.cpp @@ -1460,15 +1460,15 @@ namespace cryptonote 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; + 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: case 7: case 8: case 9: res.pow_algorithm = "RandomX"; break; - default: res.pow_algorithm = "RandomX"; break; // assumed + case 4: case 5: res.pow_algorithm = "CN/WOW"; break; + case 6: case 7: case 8: case 9: res.pow_algorithm = "RandomWOW"; break; + default: res.pow_algorithm = "RandomWOW"; break; // assumed } if (res.is_background_mining_enabled) {