process request_maintenance state during maintenance
This commit is contained in:
parent
5db4de044b
commit
49011894bd
3 changed files with 13 additions and 3 deletions
|
|
@ -400,10 +400,13 @@ void database::update_active_sons()
|
|||
|
||||
const auto& all_sons = get_index_type<son_index>().indices();
|
||||
|
||||
auto& local_vote_buffer_ref = _vote_tally_buffer;
|
||||
for( const son_object& son : all_sons )
|
||||
{
|
||||
modify( son, [&]( son_object& obj ){
|
||||
obj.total_votes = _vote_tally_buffer[son.vote_id];
|
||||
modify( son, [local_vote_buffer_ref]( son_object& obj ){
|
||||
obj.total_votes = local_vote_buffer_ref[obj.vote_id];
|
||||
if(obj.status == son_status::request_maintenance)
|
||||
obj.status = son_status::in_maintenance;
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -699,6 +699,13 @@ BOOST_AUTO_TEST_CASE( maintenance_test )
|
|||
con.wallet_api_ptr->start_son_maintenance(name, true);
|
||||
BOOST_CHECK(generate_block());
|
||||
|
||||
// check SON is in maintenance
|
||||
son_obj = con.wallet_api_ptr->get_son(name);
|
||||
BOOST_CHECK(son_obj.status == son_status::request_maintenance);
|
||||
|
||||
// process maintenance
|
||||
BOOST_CHECK(generate_maintenance_block());
|
||||
|
||||
// check SON is in maintenance
|
||||
son_obj = con.wallet_api_ptr->get_son(name);
|
||||
BOOST_CHECK(son_obj.status == son_status::in_maintenance);
|
||||
|
|
|
|||
|
|
@ -732,7 +732,7 @@ BOOST_AUTO_TEST_CASE( son_heartbeat_test ) {
|
|||
PUSH_TX( db, trx, ~0);
|
||||
generate_block();
|
||||
trx.clear();
|
||||
BOOST_CHECK( obj->status == son_status::in_maintenance);
|
||||
BOOST_CHECK( obj->status == son_status::request_maintenance);
|
||||
}
|
||||
|
||||
uint64_t downtime = 0;
|
||||
|
|
|
|||
Loading…
Reference in a new issue