32 namespace graphene {
namespace chain {
34 using boost::container::flat_set;
49 auto interval = block_interval();
56 return genesis_time + slot_num * interval;
71 return head_slot_time + (slot_num * interval);
77 if( when < first_slot_time )
79 return (when - first_slot_time).to_seconds() / block_interval() + 1;
82 uint32_t database::update_witness_missed_blocks(
const signed_block& b )
85 FC_ASSERT( missed_blocks != 0,
"Trying to push double-produced block onto current block?!" );
87 const auto& witnesses = witness_schedule_id_type()(*this).current_shuffled_witnesses;
88 if( missed_blocks < witnesses.size() )
89 for( uint32_t i = 0; i < missed_blocks; ++i ) {
104 void database::update_witness_schedule()
124 uint64_t k = now_hi + uint64_t(i)*2685821657736338717ULL;
128 k *= 2685821657736338717ULL;
131 uint32_t j = i + k%jmax;