Register a new last_id once per slot

This commit is contained in:
Michael Vines
2019-03-01 14:52:27 -08:00
parent 61beb42797
commit d5de5bec4f
6 changed files with 60 additions and 44 deletions

View File

@ -18,6 +18,8 @@ pub const DEFAULT_SLOTS_PER_EPOCH: u64 = 64;
pub const MAX_HASH_AGE_IN_SECONDS: usize = 120;
pub const MAX_RECENT_TICK_HASHES: usize = NUM_TICKS_PER_SECOND as usize * MAX_HASH_AGE_IN_SECONDS;
pub const MAX_RECENT_BLOCK_HASHES: usize =
MAX_RECENT_TICK_HASHES / (DEFAULT_TICKS_PER_SLOT as usize);
pub fn duration_as_us(d: &Duration) -> u64 {
(d.as_secs() * 1000 * 1000) + (u64::from(d.subsec_nanos()) / 1_000)