adding fix for edge case
This commit is contained in:
parent
c1b5eb95e1
commit
3f1b9bbb27
1 changed files with 11 additions and 0 deletions
|
|
@ -72,6 +72,17 @@ witness_id_type database::get_scheduled_witness( uint32_t slot_num )const
|
|||
|
||||
uint64_t current_aslot = get_dynamic_global_properties().current_aslot + slot_num;
|
||||
|
||||
if( slot_num == 0 ) // then return the witness that produced the last block
|
||||
{
|
||||
for( const witness_id_type& wit_id : active_witnesses )
|
||||
{
|
||||
const witness_object& wit = wit_id(*this);
|
||||
if( wit.last_aslot >= current_aslot )
|
||||
return wit_id;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
uint64_t start_of_current_round_aslot = current_aslot - (current_aslot % n);
|
||||
uint64_t first_ineligible_aslot = std::min( start_of_current_round_aslot, current_aslot - min_witness_separation );
|
||||
//
|
||||
|
|
|
|||
Loading…
Reference in a new issue