pub struct FullDifficultyManager<T: HeaderStoreReader> { /* private fields */ }Expand description
A difficulty manager conforming to the legacy golang implementation based on full, hence un-sampled, windows
Implementations§
Source§impl<T: HeaderStoreReader> FullDifficultyManager<T>
impl<T: HeaderStoreReader> FullDifficultyManager<T>
pub fn new( headers_store: Arc<T>, genesis_bits: u32, max_difficulty_target: Uint256, difficulty_window_size: usize, min_difficulty_window_len: usize, target_time_per_block: u64, ) -> Self
pub fn calc_daa_score_and_mergeset_non_daa_blocks<'a>( &'a self, window: &BlockWindowHeap, ghostdag_data: &GhostdagData, store: &'a (impl GhostdagStoreReader + ?Sized), ) -> (u64, BlockHashSet)
pub fn calculate_difficulty_bits(&self, window: &BlockWindowHeap) -> u32
pub fn estimate_network_hashes_per_second( &self, window: &BlockWindowHeap, ) -> DifficultyResult<u64>
Trait Implementations§
Source§impl<T: Clone + HeaderStoreReader> Clone for FullDifficultyManager<T>
impl<T: Clone + HeaderStoreReader> Clone for FullDifficultyManager<T>
Source§fn clone(&self) -> FullDifficultyManager<T>
fn clone(&self) -> FullDifficultyManager<T>
Returns a duplicate of the value. Read more
1.0.0§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl<T> Freeze for FullDifficultyManager<T>
impl<T> RefUnwindSafe for FullDifficultyManager<T>where
T: RefUnwindSafe,
impl<T> Send for FullDifficultyManager<T>
impl<T> Sync for FullDifficultyManager<T>
impl<T> Unpin for FullDifficultyManager<T>
impl<T> UnwindSafe for FullDifficultyManager<T>where
T: RefUnwindSafe,
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<S> CastArc for Swhere
S: CastFromSync + ?Sized,
impl<S> CastArc for Swhere
S: CastFromSync + ?Sized,
Source§impl<T> CastFrom for Twhere
T: Any + 'static,
impl<T> CastFrom for Twhere
T: Any + 'static,
Source§fn ref_any(&self) -> &(dyn Any + 'static)
fn ref_any(&self) -> &(dyn Any + 'static)
Returns a immutable reference to
Any, which is backed by the type implementing this trait.Source§fn mut_any(&mut self) -> &mut (dyn Any + 'static)
fn mut_any(&mut self) -> &mut (dyn Any + 'static)
Returns a mutable reference to
Any, which is backed by the type implementing this trait.Source§impl<T> CastFromSync for T
impl<T> CastFromSync for T
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more