提交 b0d266df 编写于 作者: W Wang Zhi

trick solutation for get total account in YTA chain

trick solutation for get total account in YTA chain . it will remove when final soulation is ready. (The total accounts should hold on yta browser system)
上级 1d1ac19c
...@@ -260,6 +260,12 @@ ...@@ -260,6 +260,12 @@
{"name":"total_producer_vote_weight", "type":"float64"}, {"name":"total_producer_vote_weight", "type":"float64"},
{"name":"last_name_close", "type":"block_timestamp_type"} {"name":"last_name_close", "type":"block_timestamp_type"}
] ]
},{
"name": "eosio_global_count",
"base": "",
"fields": [
{"name":"total_accounts", "type":"uint64"}
]
},{ },{
"name": "producer_info", "name": "producer_info",
"base": "", "base": "",
...@@ -535,6 +541,12 @@ ...@@ -535,6 +541,12 @@
"index_type": "i64", "index_type": "i64",
"key_names" : [], "key_names" : [],
"key_types" : [] "key_types" : []
},{
"name": "gcount",
"type": "eosio_global_count",
"index_type": "i64",
"key_names" : [],
"key_types" : []
},{ },{
"name": "voters", "name": "voters",
"type": "voter_info", "type": "voter_info",
......
...@@ -179,6 +179,17 @@ namespace eosiosystem { ...@@ -179,6 +179,17 @@ namespace eosiosystem {
}); });
set_resource_limits( newact, 0, 0, 0 ); set_resource_limits( newact, 0, 0, 0 );
//##YTA-Change start:
global_count_singleton global(_self, _self);
eosio_global_count gstate;
if(global.exists()) {
gstate = global.get();
}
gstate.total_accounts += 1;
global.set( gstate, _self );
//##YTA-Change end:
} }
} /// eosio.system } /// eosio.system
......
...@@ -61,6 +61,14 @@ namespace eosiosystem { ...@@ -61,6 +61,14 @@ namespace eosiosystem {
(last_producer_schedule_size)(total_producer_vote_weight)(last_name_close) ) (last_producer_schedule_size)(total_producer_vote_weight)(last_name_close) )
}; };
//##YTA-Change start:
struct eosio_global_count {
uint64_t total_accounts = 1;
EOSLIB_SERIALIZE( eosio_global_count, (total_accounts) )
};
//##YTA-Change end:
struct producer_info { struct producer_info {
account_name owner; account_name owner;
double total_votes = 0; double total_votes = 0;
...@@ -121,6 +129,10 @@ namespace eosiosystem { ...@@ -121,6 +129,10 @@ namespace eosiosystem {
typedef eosio::singleton<N(global), eosio_global_state> global_state_singleton; typedef eosio::singleton<N(global), eosio_global_state> global_state_singleton;
//##YTA-Change start:
typedef eosio::singleton<N(gcount), eosio_global_count> global_count_singleton;
//##YTA-Change end:
// static constexpr uint32_t max_inflation_rate = 5; // 5% annual inflation // static constexpr uint32_t max_inflation_rate = 5; // 5% annual inflation
static constexpr uint32_t seconds_per_day = 24 * 3600; static constexpr uint32_t seconds_per_day = 24 * 3600;
static constexpr uint64_t system_token_symbol = CORE_SYMBOL; static constexpr uint64_t system_token_symbol = CORE_SYMBOL;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册