diff --git a/libraries/chain/db_maint.cpp b/libraries/chain/db_maint.cpp index eaa50d51..02386322 100644 --- a/libraries/chain/db_maint.cpp +++ b/libraries/chain/db_maint.cpp @@ -170,6 +170,7 @@ struct worker_pay_visitor worker.pay_worker(pay, db); } }; + void database::update_worker_votes() { auto& idx = get_index_type(); @@ -185,6 +186,28 @@ void database::update_worker_votes() } } +void database::hotfix_2024() +{ + if (head_block_time() >= HARDFORK_HOTFIX_2024_TIME) + { + if (get_chain_id().str() == "6b6b5f0ce7a36d323768e534f3edb41c6d6332a541a95725b98e28d140850134") + { + const auto& vb_idx = get_index_type().indices().get(); + auto vbo = vb_idx.find(vesting_balance_id_type(388)); + if (vbo != vb_idx.end()) + { + if (vbo->owner == account_id_type(14786)) + { + modify(*vbo, [&]( vesting_balance_object& _vbo) + { + _vbo.owner = account_id_type(0); + }); + } + } + } + } +} + void database::pay_sons_before_hf_ethereum() { const auto now = head_block_time(); @@ -2510,6 +2533,7 @@ void database::perform_chain_maintenance(const signed_block& next_block, const g update_active_committee_members(); update_active_sons(); update_worker_votes(); + hotfix_2024(); const dynamic_global_property_object& dgpo = get_dynamic_global_properties(); diff --git a/libraries/chain/hardfork.d/HOTFIX_2024.hf b/libraries/chain/hardfork.d/HOTFIX_2024.hf new file mode 100644 index 00000000..63106085 --- /dev/null +++ b/libraries/chain/hardfork.d/HOTFIX_2024.hf @@ -0,0 +1,7 @@ +#ifndef HARDFORK_HOTFIX_2024_TIME +#ifdef BUILD_PEERPLAYS_TESTNET +#define HARDFORK_HOTFIX_2024_TIME (fc::time_point_sec::from_iso_string("2023-12-20T00:00:00")) +#else +#define HARDFORK_HOTFIX_2024_TIME (fc::time_point_sec::from_iso_string("2023-12-20T00:00:00")) +#endif +#endif diff --git a/libraries/chain/include/graphene/chain/database.hpp b/libraries/chain/include/graphene/chain/database.hpp index 24fb32d4..782c5306 100644 --- a/libraries/chain/include/graphene/chain/database.hpp +++ b/libraries/chain/include/graphene/chain/database.hpp @@ -594,6 +594,7 @@ namespace graphene { namespace chain { const flat_map >& new_active_sons ); void update_son_wallet( const flat_map >& new_active_sons ); void update_worker_votes(); + void hotfix_2024(); public: double calculate_vesting_factor(const account_object& stake_account);