Merge branch 'bug/551-son-account-operations-count' into 'develop'

#551 - fix is_son_dereg_valid funtion

See merge request PBSA/peerplays!236
This commit is contained in:
Vlad Dobromyslov 2023-07-03 19:50:59 +00:00
commit 917e09a80b

View file

@ -305,16 +305,14 @@ bool database::is_son_dereg_valid( son_id_type son_id )
} }
bool status_son_dereg_valid = true; bool status_son_dereg_valid = true;
for(const auto& status : son->statuses) for (const auto &active_sidechain_type : active_sidechain_types(head_block_time())) {
{ if(son->statuses.at(active_sidechain_type) != son_status::in_maintenance)
const auto& sidechain = status.first;
if(status.second != son_status::in_maintenance)
status_son_dereg_valid = false; status_son_dereg_valid = false;
if(status_son_dereg_valid) if(status_son_dereg_valid)
{ {
if(son->statistics(*this).last_active_timestamp.contains(sidechain)) { if(son->statistics(*this).last_active_timestamp.contains(active_sidechain_type)) {
if (head_block_time() - son->statistics(*this).last_active_timestamp.at(sidechain) < fc::seconds(get_global_properties().parameters.son_deregister_time())) { if (head_block_time() - son->statistics(*this).last_active_timestamp.at(active_sidechain_type) < fc::seconds(get_global_properties().parameters.son_deregister_time())) {
status_son_dereg_valid = false; status_son_dereg_valid = false;
} }
} }