Skip to content

Commit 824ec64

Browse files
author
Vlad Dobromyslov
committed
#377 - remove IDs if there were in schedule_set earlier
1 parent 1b0ddac commit 824ec64

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

libraries/chain/include/graphene/chain/witness_scheduler.hpp

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -162,8 +162,12 @@ class generic_witness_scheduler
162162
_schedule.pop_front();
163163

164164
auto it = _lame_duck.find( result );
165-
if( it != _lame_duck.end() )
166-
_lame_duck.erase( it );
165+
if( it != _lame_duck.end() ) {
166+
set< WitnessID > removal_set;
167+
removal_set.insert(*it);
168+
remove_all( removal_set );
169+
_lame_duck.erase(it);
170+
}
167171
if( debug ) check_invariant();
168172
return result;
169173
}
@@ -389,7 +393,7 @@ class generic_witness_scheduler
389393
// scheduled
390394
std::deque < WitnessID > _schedule;
391395

392-
// in _schedule, but not to be replaced
396+
// in _schedule, but must be removed
393397
set< WitnessID > _lame_duck;
394398
};
395399

0 commit comments

Comments
 (0)