diff --git a/contracts/eosio.system/voting.cpp b/contracts/eosio.system/voting.cpp index 31bf70593363fb18e58f8d3b583fb75cd1c225ff..166f1707cd759122e3ba1cca36eb328af1e366e8 100644 --- a/contracts/eosio.system/voting.cpp +++ b/contracts/eosio.system/voting.cpp @@ -152,7 +152,7 @@ namespace eosiosystem { */ if( voter->last_vote_weight <= 0.0 ) { _gstate.total_activated_stake += voter->staked; - if( _gstate.total_activated_stake >= min_activated_stake ) { + if( _gstate.total_activated_stake >= min_activated_stake && _gstate.thresh_activated_stake_time == 0 ) { _gstate.thresh_activated_stake_time = current_time(); } } diff --git a/unittests/eosio.system_tests.cpp b/unittests/eosio.system_tests.cpp index b823eb5a550bf718855452c94923d80eae6964d1..25215161d5859055215b935ad7cfbf2cbcc628a3 100644 --- a/unittests/eosio.system_tests.cpp +++ b/unittests/eosio.system_tests.cpp @@ -2063,11 +2063,14 @@ BOOST_FIXTURE_TEST_CASE( buyname, eosio_system_tester ) try { transfer( config::system_account_name, "dan", core_from_string( "10000.0000" ) ); transfer( config::system_account_name, "sam", core_from_string( "10000.0000" ) ); stake_with_transfer( config::system_account_name, "sam", core_from_string( "80000000.0000" ), core_from_string( "80000000.0000" ) ); + stake_with_transfer( config::system_account_name, "dan", core_from_string( "80000000.0000" ), core_from_string( "80000000.0000" ) ); regproducer( config::system_account_name ); BOOST_REQUIRE_EQUAL( success(), vote( N(sam), { config::system_account_name } ) ); // wait 14 days after min required amount has been staked - produce_block( fc::days(14) ); + produce_block( fc::days(7) ); + BOOST_REQUIRE_EQUAL( success(), vote( N(dan), { config::system_account_name } ) ); + produce_block( fc::days(7) ); produce_block(); BOOST_REQUIRE_EXCEPTION( create_accounts_with_resources( { N(fail) }, N(dan) ), // dan shouldn't be able to create fail