WindowManager

Trait WindowManager 

Source
pub trait WindowManager {
    // Required methods
    fn block_window(
        &self,
        ghostdag_data: &GhostdagData,
        window_type: WindowType,
    ) -> Result<Arc<BlockWindowHeap>, RuleError>;
    fn calc_daa_window(
        &self,
        ghostdag_data: &GhostdagData,
        window: Arc<BlockWindowHeap>,
    ) -> DaaWindow;
    fn block_daa_window(
        &self,
        ghostdag_data: &GhostdagData,
    ) -> Result<DaaWindow, RuleError>;
    fn calculate_difficulty_bits(
        &self,
        ghostdag_data: &GhostdagData,
        daa_window: &DaaWindow,
    ) -> u32;
    fn calc_past_median_time(
        &self,
        ghostdag_data: &GhostdagData,
    ) -> Result<(u64, Arc<BlockWindowHeap>), RuleError>;
    fn estimate_network_hashes_per_second(
        &self,
        window: Arc<BlockWindowHeap>,
    ) -> DifficultyResult<u64>;
    fn window_size(
        &self,
        ghostdag_data: &GhostdagData,
        window_type: WindowType,
    ) -> usize;
    fn sample_rate(
        &self,
        ghostdag_data: &GhostdagData,
        window_type: WindowType,
    ) -> u64;
}

Required Methods§

Source

fn block_window( &self, ghostdag_data: &GhostdagData, window_type: WindowType, ) -> Result<Arc<BlockWindowHeap>, RuleError>

Source

fn calc_daa_window( &self, ghostdag_data: &GhostdagData, window: Arc<BlockWindowHeap>, ) -> DaaWindow

Source

fn block_daa_window( &self, ghostdag_data: &GhostdagData, ) -> Result<DaaWindow, RuleError>

Source

fn calculate_difficulty_bits( &self, ghostdag_data: &GhostdagData, daa_window: &DaaWindow, ) -> u32

Source

fn calc_past_median_time( &self, ghostdag_data: &GhostdagData, ) -> Result<(u64, Arc<BlockWindowHeap>), RuleError>

Source

fn estimate_network_hashes_per_second( &self, window: Arc<BlockWindowHeap>, ) -> DifficultyResult<u64>

Source

fn window_size( &self, ghostdag_data: &GhostdagData, window_type: WindowType, ) -> usize

Source

fn sample_rate( &self, ghostdag_data: &GhostdagData, window_type: WindowType, ) -> u64

Implementors§