fixed up some missing copyright messages; added unlock_time validation for protocol_tx outputs

This commit is contained in:
Some Random Crypto Guy
2024-06-10 14:54:57 +01:00
parent e69437ca6a
commit 584890ab25
17 changed files with 29 additions and 25 deletions
+4 -12
View File
@@ -1486,7 +1486,7 @@ namespace cryptonote
res.is_background_mining_enabled = lMiner.get_is_background_mining_enabled();
store_difficulty(m_core.get_blockchain_storage().get_difficulty_for_next_block(), res.difficulty, res.wide_difficulty, res.difficulty_top64);
res.block_target = m_core.get_blockchain_storage().get_current_hard_fork_version() < 2 ? DIFFICULTY_TARGET_V1 : DIFFICULTY_TARGET_V2;
res.block_target = DIFFICULTY_TARGET_V2;
if ( lMiner.is_mining() ) {
res.speed = lMiner.get_speed();
res.threads_count = lMiner.get_threads_count();
@@ -1495,17 +1495,9 @@ namespace cryptonote
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);
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)
{
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
}
res.pow_algorithm = "RandomX";
if (res.is_background_mining_enabled)
{
res.bg_idle_threshold = lMiner.get_idle_threshold();