提交 558ba7d7 编写于 作者: W Wang Zhi

update for testnet

上级 e2280ac0
......@@ -8,7 +8,7 @@ namespace eosiosystem {
//##YTA-Change start:
//Change total vote rate from 15% to 1% for test network
//const int64_t min_activated_stake = 150'000'000'0000;
const int64_t min_activated_stake = 150'000'0000;
const int64_t min_activated_stake = 5'000'0000;
//##YTA-Change end:
const uint32_t blocks_per_year = 52*7*24*2*3600; // half seconds per year
const uint32_t seconds_per_year = 52*7*24*3600;
......@@ -68,12 +68,8 @@ namespace eosiosystem {
/// only update block producers once every minute, block_timestamp is in half seconds
//if( timestamp.slot - _gstate.last_producer_schedule_update.slot > 120 ) {
/// update block producers once every two minute due to election strategy is more complex than before
if( timestamp.slot - _gstate.last_producer_schedule_update.slot > 240 ) {
if( timestamp.slot - _gstate.last_producer_schedule_update.slot > 120 ) {
//##YTA-Change end:
print("update_elected_producers -------------------------------------\n");
print("--------------------------------------------------------------\n");
print("--------------------------------------------------------------\n");
print("--------------------------------------------------------------\n");
update_elected_producers( timestamp );
//update_elected_producers_yta( timestamp );
......@@ -101,6 +97,9 @@ namespace eosiosystem {
void system_contract::claimrewards( const account_name& owner ) {
require_auth(owner);
//@@@@@@@@@@@@@@@@@@@@
return;
const auto& prod = _producers.get( owner );
eosio_assert( prod.active(), "producer does not have an active key" );
......
......@@ -92,6 +92,9 @@ namespace eosiosystem {
void system_contract::unregprod( const account_name producer ) {
require_auth( producer );
///@@@@@@@@@@@@@@@@@@@@@
return;
const auto& prod = _producers.get( producer, "producer not found" );
_producers.modify( prod, 0, [&]( producer_info& info ){
......@@ -475,8 +478,6 @@ namespace eosiosystem {
top_producers.emplace_back( std::pair<eosio::producer_key,uint16_t>({{it->owner, it->producer_key}, it->location}) );
}
print("update_elected_producers 1 -------------------------------------\n");
print("update_elected_producers top_producers.size() = " , top_producers.size() , "\n");
if ( top_producers.size() < _gstate.last_producer_schedule_size ) {
return;
......@@ -493,10 +494,8 @@ namespace eosiosystem {
bytes packed_schedule = pack(producers);
print("update_elected_producers 2 -------------------------------------\n");
if( set_proposed_producers( packed_schedule.data(), packed_schedule.size() ) >= 0 ) {
print("update_elected_producers 3 -------------------------------------\n");
_gstate.last_producer_schedule_size = static_cast<decltype(_gstate.last_producer_schedule_size)>( top_producers.size() );
}
}
......@@ -525,6 +524,11 @@ namespace eosiosystem {
*/
void system_contract::voteproducer( const account_name voter_name, const account_name proxy, const std::vector<account_name>& producers ) {
require_auth( voter_name );
///@@@@@@@@@@@@@@@@@@@@@
eosio_assert(1 == 2, "can not vote now.");
return;
///@@@@@@@@@@@@@@@@@@@@
update_votes( voter_name, proxy, producers, true );
}
......
......@@ -553,13 +553,21 @@ void hddpool::clearall(name owner)
{
require_auth(_self);
account_name producers[21];
uint32_t bytes_populated = get_active_producers(producers, sizeof(account_name) * 21);
uint32_t count = bytes_populated / sizeof(account_name);
for (uint32_t i = 0; i < count; i++)
{
print("producer -", (name{producers[i]}), "--\n");
}
/*
minerinfo_table _minerinfo( _self , _self );
auto itminerinfo = _minerinfo.find(863);
_minerinfo.modify(itminerinfo, _self, [&](auto &row) {
row.space_left = 50;
});
});
*/
/*
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册