pub struct ProofOfWorkConfig {
pub test_mode: bool,
pub use_octopus_in_test_mode: bool,
pub mining_type: MiningType,
pub initial_difficulty: u64,
pub block_generation_period: u64,
pub stratum_listen_addr: String,
pub stratum_port: u16,
pub stratum_secret: Option<H256>,
pub pow_problem_window_size: usize,
pub cip86_height: u64,
}
Fields§
§test_mode: bool
§use_octopus_in_test_mode: bool
§mining_type: MiningType
§initial_difficulty: u64
§block_generation_period: u64
§stratum_listen_addr: String
§stratum_port: u16
§stratum_secret: Option<H256>
§pow_problem_window_size: usize
§cip86_height: u64
Implementations§
Source§impl ProofOfWorkConfig
impl ProofOfWorkConfig
pub fn new( test_mode: bool, use_octopus_in_test_mode: bool, mining_type: &str, initial_difficulty: Option<u64>, stratum_listen_addr: String, stratum_port: u16, stratum_secret: Option<H256>, pow_problem_window_size: usize, cip86_height: u64, ) -> Self
pub fn difficulty_adjustment_epoch_period(&self, cur_height: u64) -> u64
pub fn use_octopus(&self) -> bool
pub fn use_stratum(&self) -> bool
pub fn enable_mining(&self) -> bool
pub fn target_difficulty( &self, block_count: u64, timespan: u64, cur_difficulty: &U256, ) -> U256
pub fn get_adjustment_bound(&self, diff: U256) -> (U256, U256)
Trait Implementations§
Source§impl Clone for ProofOfWorkConfig
impl Clone for ProofOfWorkConfig
Source§fn clone(&self) -> ProofOfWorkConfig
fn clone(&self) -> ProofOfWorkConfig
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for ProofOfWorkConfig
impl Debug for ProofOfWorkConfig
Auto Trait Implementations§
impl Freeze for ProofOfWorkConfig
impl RefUnwindSafe for ProofOfWorkConfig
impl Send for ProofOfWorkConfig
impl Sync for ProofOfWorkConfig
impl Unpin for ProofOfWorkConfig
impl UnwindSafe for ProofOfWorkConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more