Skip to content

Commit

Permalink
Merge branch 'bug/377-invalid-scheduler' into 'feature/son-for-hive-v…
Browse files Browse the repository at this point in the history
…oting'

#377 - remove IDs if there were in schedule_set earlier

See merge request PBSA/peerplays!121
  • Loading branch information
serkixenos committed Jun 1, 2022
2 parents 1b0ddac + 824ec64 commit 002b7b7
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions libraries/chain/include/graphene/chain/witness_scheduler.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -162,8 +162,12 @@ class generic_witness_scheduler
_schedule.pop_front();

auto it = _lame_duck.find( result );
if( it != _lame_duck.end() )
_lame_duck.erase( it );
if( it != _lame_duck.end() ) {
set< WitnessID > removal_set;
removal_set.insert(*it);
remove_all( removal_set );
_lame_duck.erase(it);
}
if( debug ) check_invariant();
return result;
}
Expand Down Expand Up @@ -389,7 +393,7 @@ class generic_witness_scheduler
// scheduled
std::deque < WitnessID > _schedule;

// in _schedule, but not to be replaced
// in _schedule, but must be removed
set< WitnessID > _lame_duck;
};

Expand Down

0 comments on commit 002b7b7

Please sign in to comment.