diff --git a/src/blockchain_db/blockchain_db.h b/src/blockchain_db/blockchain_db.h index d2db9a8f0..2d5419591 100644 --- a/src/blockchain_db/blockchain_db.h +++ b/src/blockchain_db/blockchain_db.h @@ -1,4 +1,5 @@ // Copyright (c) 2014-2023, The Monero Project +// Portions Copyright (c) 2023-2024, Salvium (author: SRCG) // // All rights reserved. // diff --git a/src/blockchain_db/lmdb/db_lmdb.cpp b/src/blockchain_db/lmdb/db_lmdb.cpp index ad640545c..78184a564 100644 --- a/src/blockchain_db/lmdb/db_lmdb.cpp +++ b/src/blockchain_db/lmdb/db_lmdb.cpp @@ -1,5 +1,5 @@ // Copyright (c) 2014-2023, The Monero Project -// Portions Copyright (c) 2023, Salvium (author: SRCG) +// Portions Copyright (c) 2023-2024, Salvium (author: SRCG) // All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, are diff --git a/src/cryptonote_basic/cryptonote_basic.h b/src/cryptonote_basic/cryptonote_basic.h index 597c1acdb..fa082c1c5 100644 --- a/src/cryptonote_basic/cryptonote_basic.h +++ b/src/cryptonote_basic/cryptonote_basic.h @@ -1,4 +1,5 @@ // Copyright (c) 2014-2022, The Monero Project +// Portions Copyright (c) 2023-2024, Salvium (author: SRCG) // // All rights reserved. // diff --git a/src/cryptonote_basic/cryptonote_format_utils.cpp b/src/cryptonote_basic/cryptonote_format_utils.cpp index ee059fe74..f06bdf53f 100644 --- a/src/cryptonote_basic/cryptonote_format_utils.cpp +++ b/src/cryptonote_basic/cryptonote_format_utils.cpp @@ -1,4 +1,5 @@ // Copyright (c) 2014-2022, The Monero Project +// Portions Copyright (c) 2023-2024, Salvium (author: SRCG) // // All rights reserved. // diff --git a/src/cryptonote_basic/cryptonote_format_utils.h b/src/cryptonote_basic/cryptonote_format_utils.h index 77cf7fda0..5843853bd 100644 --- a/src/cryptonote_basic/cryptonote_format_utils.h +++ b/src/cryptonote_basic/cryptonote_format_utils.h @@ -1,4 +1,5 @@ // Copyright (c) 2014-2022, The Monero Project +// Portions Copyright (c) 2023-2024, Salvium (author: SRCG) // // All rights reserved. // diff --git a/src/cryptonote_core/blockchain.cpp b/src/cryptonote_core/blockchain.cpp index 091f475cd..63a95e4da 100644 --- a/src/cryptonote_core/blockchain.cpp +++ b/src/cryptonote_core/blockchain.cpp @@ -1,4 +1,5 @@ // Copyright (c) 2014-2022, The Monero Project +// Portions Copyright (c) 2023-2024, Salvium (author: SRCG) // // All rights reserved. // @@ -1422,10 +1423,7 @@ bool Blockchain::prevalidate_protocol_transaction(const block& b, uint64_t heigh return false; } MDEBUG("Protocol tx hash: " << get_transaction_hash(b.protocol_tx)); - //CHECK_AND_ASSERT_MES(b.protocol_tx.unlock_time == height, false, "coinbase protocol transaction transaction has the wrong unlock time=" << b.protocol_tx.unlock_time << ", expected " << height + CRYPTONOTE_MINED_MONEY_UNLOCK_WINDOW); - // SRCG - we still need to make output checks - /* //check outs overflow if(!check_outs_overflow(b.protocol_tx)) { @@ -1433,8 +1431,8 @@ bool Blockchain::prevalidate_protocol_transaction(const block& b, uint64_t heigh return false; } - CHECK_AND_ASSERT_MES(check_output_types(b.miner_tx, hf_version), false, "miner transaction has invalid output type(s) in block " << get_block_hash(b)); - */ + CHECK_AND_ASSERT_MES(check_output_types(b.protocol_tx, hf_version), false, "protocol transaction has invalid output type(s) in block " << get_block_hash(b)); + return true; } //------------------------------------------------------------------ @@ -1496,9 +1494,11 @@ bool Blockchain::validate_protocol_transaction(const block& b, uint64_t height, for (auto& o : b.protocol_tx.vout) { if (o.target.type() == typeid(txout_to_key)) { txout_to_key out = boost::get(o.target); + CHECK_AND_ASSERT_MES(out.unlock_time == CRYPTONOTE_MINED_MONEY_UNLOCK_WINDOW, false, "Invalid unlock time on protocol_tx output"); outputs[out.key] = {out.asset_type, o.amount, out.unlock_time}; } else if (o.target.type() == typeid(txout_to_tagged_key)) { txout_to_tagged_key out = boost::get(o.target); + CHECK_AND_ASSERT_MES(out.unlock_time == CRYPTONOTE_MINED_MONEY_UNLOCK_WINDOW, false, "Invalid unlock time on protocol_tx output"); outputs[out.key] = {out.asset_type, o.amount, out.unlock_time}; } else { MERROR("Block at height: " << height << " attempting to add protocol transaction with invalid type " << o.target.type().name()); @@ -1566,7 +1566,7 @@ bool Blockchain::validate_protocol_transaction(const block& b, uint64_t height, return false; } if (amount_minted_check != output_amount) { - LOG_ERROR("Block at height: " << height << " - Output amount does not match amount_burnt for refunded TX id " << tx->hash << " - rejecting block"); + LOG_ERROR("Block at height: " << height << " - Output amount does not match amount minted for converted TX id " << tx->hash << " - rejecting block"); return false; } @@ -1581,12 +1581,12 @@ bool Blockchain::validate_protocol_transaction(const block& b, uint64_t height, } // Can we have matured STAKE transactions yet? - uint64_t lock_period = get_config(m_nettype).STAKE_LOCK_PERIOD; - if (height > lock_period) { + uint64_t stake_lock_period = get_config(m_nettype).STAKE_LOCK_PERIOD; + if (height > stake_lock_period) { // Yes - Get the staking data for the block that matured this time cryptonote::yield_block_info ybi_matured; - uint64_t matured_height = height - lock_period - 1; + uint64_t matured_height = height - stake_lock_period - 1; bool ok = get_ybi_entry(matured_height, ybi_matured); if (ok && ybi_matured.locked_coins_this_block > 0) { diff --git a/src/cryptonote_core/cryptonote_tx_utils.cpp b/src/cryptonote_core/cryptonote_tx_utils.cpp index 2b03ff06a..277ec5e46 100644 --- a/src/cryptonote_core/cryptonote_tx_utils.cpp +++ b/src/cryptonote_core/cryptonote_tx_utils.cpp @@ -1,5 +1,5 @@ // Copyright (c) 2014-2022, The Monero Project -// Portions Copyright (c) 2023, Salvium (author: SRCG) +// Portions Copyright (c) 2023-2024, Salvium (author: SRCG) // // All rights reserved. // diff --git a/src/cryptonote_core/cryptonote_tx_utils.h b/src/cryptonote_core/cryptonote_tx_utils.h index 67c6f3c5d..a34262753 100644 --- a/src/cryptonote_core/cryptonote_tx_utils.h +++ b/src/cryptonote_core/cryptonote_tx_utils.h @@ -1,4 +1,5 @@ // Copyright (c) 2014-2022, The Monero Project +// Portions Copyright (c) 2023-2024, Salvium (author: SRCG) // // All rights reserved. // diff --git a/src/daemon/rpc_command_executor.cpp b/src/daemon/rpc_command_executor.cpp index aad7ddc5c..c4c3ebd17 100644 --- a/src/daemon/rpc_command_executor.cpp +++ b/src/daemon/rpc_command_executor.cpp @@ -615,8 +615,8 @@ bool t_rpc_command_executor::mining_status() { uint64_t daily = 86400ull / mres.block_target * mres.block_reward * ratio; uint64_t monthly = 86400ull / mres.block_target * 30.5 * mres.block_reward * ratio; uint64_t yearly = 86400ull / mres.block_target * 356 * mres.block_reward * ratio; - tools::msg_writer() << "Expected: " << cryptonote::print_money(daily) << " monero daily, " - << cryptonote::print_money(monthly) << " monero monthly, " << cryptonote::print_money(yearly) << " yearly"; + tools::msg_writer() << "Expected: " << (daily / COIN) << " SALs daily, " + << (monthly / COIN) << " SALs monthly, " << (yearly / COIN) << " yearly"; } return true; diff --git a/src/ringct/rctSigs.cpp b/src/ringct/rctSigs.cpp index a7593549f..6507d5da6 100644 --- a/src/ringct/rctSigs.cpp +++ b/src/ringct/rctSigs.cpp @@ -1,4 +1,5 @@ // Copyright (c) 2016, Monero Research Labs +// Portions Copyright (c) 2023-2024, Salvium (author: SRCG) // // Author: Shen Noether // diff --git a/src/ringct/rctSigs.h b/src/ringct/rctSigs.h index 38e1d64bc..d0b4482e0 100644 --- a/src/ringct/rctSigs.h +++ b/src/ringct/rctSigs.h @@ -1,4 +1,5 @@ // Copyright (c) 2016, Monero Research Labs +// Portions Copyright (c) 2023-2024, Salvium (author: SRCG) // // Author: Shen Noether // diff --git a/src/ringct/rctTypes.h b/src/ringct/rctTypes.h index 3e092d675..32e4d694c 100644 --- a/src/ringct/rctTypes.h +++ b/src/ringct/rctTypes.h @@ -1,4 +1,5 @@ // Copyright (c) 2016, Monero Research Labs +// Portions Copyright (c) 2023-2024, Salvium (author: SRCG) // // Author: Shen Noether // diff --git a/src/rpc/core_rpc_server.cpp b/src/rpc/core_rpc_server.cpp index 15826c1c6..d57115d5c 100644 --- a/src/rpc/core_rpc_server.cpp +++ b/src/rpc/core_rpc_server.cpp @@ -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(); diff --git a/src/simplewallet/simplewallet.cpp b/src/simplewallet/simplewallet.cpp index a8e278800..a29ce5ed3 100644 --- a/src/simplewallet/simplewallet.cpp +++ b/src/simplewallet/simplewallet.cpp @@ -1,4 +1,5 @@ // Copyright (c) 2014-2022, The Monero Project +// Portions Copyright (c) 2023-2024, Salvium (author: SRCG) // // All rights reserved. // diff --git a/src/simplewallet/simplewallet.h b/src/simplewallet/simplewallet.h index b67329f6e..b467125b6 100644 --- a/src/simplewallet/simplewallet.h +++ b/src/simplewallet/simplewallet.h @@ -1,4 +1,5 @@ // Copyright (c) 2014-2022, The Monero Project +// Portions Copyright (c) 2023-2024, Salvium (author: SRCG) // // All rights reserved. // diff --git a/src/wallet/wallet2.cpp b/src/wallet/wallet2.cpp index 04153f675..67abbb710 100644 --- a/src/wallet/wallet2.cpp +++ b/src/wallet/wallet2.cpp @@ -1,4 +1,5 @@ // Copyright (c) 2014-2022, The Monero Project +// Portions Copyright (c) 2023-2024, Salvium (author: SRCG) // // All rights reserved. // diff --git a/src/wallet/wallet2.h b/src/wallet/wallet2.h index c071fb439..d296ec653 100644 --- a/src/wallet/wallet2.h +++ b/src/wallet/wallet2.h @@ -1,4 +1,5 @@ // Copyright (c) 2014-2022, The Monero Project +// Portions Copyright (c) 2023-2024, Salvium (author: SRCG) // // All rights reserved. //