Skip to content

Commit

Permalink
Updates for hard fork
Browse files Browse the repository at this point in the history
  • Loading branch information
fmackenzie committed Dec 2, 2024
1 parent 03783a6 commit 2b4772d
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 6 deletions.
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ message(STATUS "CMake version ${CMAKE_VERSION}")

set(CMAKE_EXPORT_COMPILE_COMMANDS ON)

add_definitions(-DPTHREAD_STACK_MIN=16384)

list(INSERT CMAKE_MODULE_PATH 0
"${CMAKE_CURRENT_SOURCE_DIR}/cmake")
include(CheckCCompilerFlag)
Expand Down
3 changes: 3 additions & 0 deletions src/cryptonote_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,9 @@ namespace config
std::string const DEV_FUND_WALLET = "TvzdbKGga5fSr7fgCTuvR1GY4g9v3No28a6QrcdnnwBkFtisk4MKPLnARAunWBxQJ82L96nGS3ET7BQMhzM788Kp1pweuUfPD";
std::string const NEW_GOV_WALLET = "TvzXGov4tNr6jYG2gdox7bcuEBwwSTpQYAb6w7qgSxuu4hsxY9CMgMgaL6EeqVcQ6hS7Cppn73W8ZSMU8gLMi4N42yTShfkP9";
std::string const NEW_DEV_WALLET = "Tw1XDEVkfVsRFhvjPQJgTjFi4uXDBiMomYeaaaj43SHPSTyLj8nBkdv2KBV8t9CzuCUy1fgYkk9tse6xA3B5oPJZ1jLfHLDrh";
std::string const HOR_GOV_WALLET = "Tw18Upu92dy7T5Xe9NSey5ZwrTD42FSQP63B1yz5phVxZo6yNv3fnXxD6N38k72wxEf1SXCwUt55ZVSCguvLWLh62qAbTAvKT";
std::string const HOR_DEV_WALLET = "TvzZDh7fe8pQVh6k5LG6KrCEMMYQf6KkFYLUX1rtaMopSR47NkCXkFmAg5tKJqbFdSgmarBYEvEt14Ekh1j96ZCD16sz548KE";


namespace testnet
{
Expand Down
27 changes: 24 additions & 3 deletions src/cryptonote_core/blockchain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1353,7 +1353,14 @@ bool Blockchain::validate_miner_transaction(const block& b, size_t cumulative_bl
return false;
}

if (hard_fork_version >= 19)
if (hard_fork_version >= 22)
{
if (!validate_governance_reward_key(height, *cryptonote::get_config(m_nettype).HOR_GOV_WALLET, vout_end - 2, boost::get<cryptonote::txout_to_key>(b.miner_tx.vout[vout_end - 2].target).key, m_nettype))
{
MERROR("Governance reward public key incorrect");
return false;
}
} else if (hard_fork_version >= 19)
{
if (!validate_governance_reward_key(height, *cryptonote::get_config(m_nettype).NEW_GOV_WALLET, vout_end - 2, boost::get<cryptonote::txout_to_key>(b.miner_tx.vout[vout_end - 2].target).key, m_nettype))
{
Expand All @@ -1376,7 +1383,14 @@ bool Blockchain::validate_miner_transaction(const block& b, size_t cumulative_bl
return false;
}

if (hard_fork_version >= 19)
if (hard_fork_version >= 22)
{
if (!validate_dev_fund_reward_key(height, *cryptonote::get_config(m_nettype).HOR_DEV_WALLET, vout_end - 1, boost::get<cryptonote::txout_to_key>(b.miner_tx.vout[vout_end - 1].target).key, m_nettype))
{
MERROR("Dev fund reward public key incorrect");
return false;
}
} else if (hard_fork_version >= 19)
{
if (!validate_dev_fund_reward_key(height, *cryptonote::get_config(m_nettype).NEW_DEV_WALLET, vout_end - 1, boost::get<cryptonote::txout_to_key>(b.miner_tx.vout[vout_end - 1].target).key, m_nettype))
{
Expand All @@ -1402,7 +1416,14 @@ bool Blockchain::validate_miner_transaction(const block& b, size_t cumulative_bl
return false;
}

if (hard_fork_version >= 19)
if (hard_fork_version >= 22)
{
if (!validate_dev_fund_reward_key(height, *cryptonote::get_config(m_nettype).HOR_DEV_WALLET, b.miner_tx.vout.size() - 1, boost::get<txout_to_key>(b.miner_tx.vout.back().target).key, m_nettype))
{
MERROR("Dev Fund reward public key incorrect");
return false;
}
} else if (hard_fork_version >= 19)
{
if (!validate_dev_fund_reward_key(height, *cryptonote::get_config(m_nettype).NEW_DEV_WALLET, b.miner_tx.vout.size() - 1, boost::get<txout_to_key>(b.miner_tx.vout.back().target).key, m_nettype))
{
Expand Down
8 changes: 6 additions & 2 deletions src/cryptonote_core/cryptonote_tx_utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -479,8 +479,10 @@ namespace cryptonote
cryptonote::get_account_address_from_str(governance_wallet_address, nettype, *cryptonote::get_config(nettype).BRIDGE_WALLET_ADDRESS);
} else if (hard_fork_version < 19) {
cryptonote::get_account_address_from_str(governance_wallet_address, nettype, *cryptonote::get_config(nettype).NEW_BRIDGE_WALLET_ADDRESS);
} else {
} else if (hard_fork_version < 22) {
cryptonote::get_account_address_from_str(governance_wallet_address, nettype, *cryptonote::get_config(nettype).NEW_GOV_WALLET);
} else {
cryptonote::get_account_address_from_str(governance_wallet_address, nettype, *cryptonote::get_config(nettype).HOR_GOV_WALLET);
}
crypto::public_key out_eph_public_key{};

Expand All @@ -504,8 +506,10 @@ namespace cryptonote
cryptonote::address_parse_info dev_fund_wallet_address;
if (hard_fork_version < 19) {
cryptonote::get_account_address_from_str(dev_fund_wallet_address, nettype, *cryptonote::get_config(nettype).DEV_FUND_WALLET);
} else {
} else if (hard_fork_version < 22) {
cryptonote::get_account_address_from_str(dev_fund_wallet_address, nettype, *cryptonote::get_config(nettype).NEW_DEV_WALLET);
} else {
cryptonote::get_account_address_from_str(dev_fund_wallet_address, nettype, *cryptonote::get_config(nettype).HOR_DEV_WALLET);
}
crypto::public_key out_eph_public_key{};

Expand Down
3 changes: 2 additions & 1 deletion src/hardforks/hardforks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@ const hardfork_t mainnet_hard_forks[] = {
{ 18, 1238350, 0, 1704230052 },
{ 19, 1248886, 0, 1705611030 },
{ 20, 1251600, 0, 1706055089 },
{ 21, 1327780, 0, 1717011940 }
{ 21, 1327780, 0, 1717011940 },
{ 22, 1466251, 0, 1733765477 }
};
const size_t num_mainnet_hard_forks = sizeof(mainnet_hard_forks) / sizeof(mainnet_hard_forks[0]);

Expand Down

0 comments on commit 2b4772d

Please sign in to comment.