Skip to content

Commit

Permalink
[config] disable_miner_client set to true in main network. (starcoino…
Browse files Browse the repository at this point in the history
  • Loading branch information
jolestar authored and naughtyvenom committed Jul 19, 2021
1 parent aa9f51f commit 6dc36bb
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions config/src/miner_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ pub struct MinerConfig {

#[serde(skip_serializing_if = "Option::is_none")]
#[structopt(long = "disable-miner-client")]
/// Don't start a miner client in node.
/// Don't start a miner client in node. The main network miner client is disable in default.
/// This flag support both cli and config file.
pub disable_miner_client: Option<bool>,

Expand All @@ -41,7 +41,9 @@ impl MinerConfig {
self.base.as_ref().expect("Config should init")
}
pub fn disable_miner_client(&self) -> bool {
self.disable_miner_client.unwrap_or(false)
//The main network miner client is disable in default.
self.disable_miner_client
.unwrap_or_else(|| self.base().net.is_main())
}
pub fn is_disable_mint_empty_block(&self) -> bool {
self.disable_mint_empty_block
Expand Down

0 comments on commit 6dc36bb

Please sign in to comment.