|
32 | 32 |
|
33 | 33 | #include <graphene/chain/account_object.hpp>
|
34 | 34 | #include <graphene/chain/asset_object.hpp>
|
| 35 | +#include <graphene/chain/balance_object.hpp> |
35 | 36 | #include <graphene/chain/budget_record_object.hpp>
|
36 | 37 | #include <graphene/chain/buyback_object.hpp>
|
37 | 38 | #include <graphene/chain/chain_property_object.hpp>
|
@@ -970,6 +971,22 @@ void process_hf_1465( database& db )
|
970 | 971 | }
|
971 | 972 | }
|
972 | 973 |
|
| 974 | +/**** |
| 975 | + * @brief a one-time data process to correct current_supply of BTS token in the BitShares mainnet |
| 976 | + */ |
| 977 | +void process_hf_2103( database& db ) |
| 978 | +{ |
| 979 | + const balance_object* bal = db.find( balance_id_type( HARDFORK_CORE_2103_BALANCE_ID ) ); |
| 980 | + if( bal != nullptr && bal->balance.amount < 0 ) |
| 981 | + { |
| 982 | + const asset_dynamic_data_object& ddo = bal->balance.asset_id(db).dynamic_data(db); |
| 983 | + db.modify<asset_dynamic_data_object>( ddo, [bal](asset_dynamic_data_object& obj) { |
| 984 | + obj.current_supply -= bal->balance.amount; |
| 985 | + }); |
| 986 | + db.remove( *bal ); |
| 987 | + } |
| 988 | +} |
| 989 | + |
973 | 990 | void update_median_feeds(database& db)
|
974 | 991 | {
|
975 | 992 | time_point_sec head_time = db.head_block_time();
|
@@ -1227,6 +1244,10 @@ void database::perform_chain_maintenance(const signed_block& next_block, const g
|
1227 | 1244 | if ( dgpo.next_maintenance_time <= HARDFORK_CORE_1465_TIME && next_maintenance_time > HARDFORK_CORE_1465_TIME )
|
1228 | 1245 | process_hf_1465(*this);
|
1229 | 1246 |
|
| 1247 | + // Fix supply issue |
| 1248 | + if ( dgpo.next_maintenance_time <= HARDFORK_CORE_2103_TIME && next_maintenance_time > HARDFORK_CORE_2103_TIME ) |
| 1249 | + process_hf_2103(*this); |
| 1250 | + |
1230 | 1251 | modify(dgpo, [next_maintenance_time](dynamic_global_property_object& d) {
|
1231 | 1252 | d.next_maintenance_time = next_maintenance_time;
|
1232 | 1253 | d.accounts_registered_this_interval = 0;
|
|
0 commit comments