Expose config max-round-blocks-to-import (#9439)

* Expose config max-round-blocks-to-import

* Fix test
This commit is contained in:
Wei Tang
2018-10-26 19:21:36 +08:00
committed by Afri Schoedon
parent e7f1204fa4
commit 1ff827b2ea
8 changed files with 50 additions and 16 deletions

View File

@@ -785,6 +785,10 @@ usage! {
"--stratum-secret=[STRING]",
"Secret for authorizing Stratum server for peers.",
ARG arg_max_round_blocks_to_import: (usize) = 12usize, or |c: &Config| c.mining.as_ref()?.max_round_blocks_to_import.clone(),
"--max-round-blocks-to-import=[S]",
"Maximal number of blocks to import for each import round.",
["Internal Options"]
FLAG flag_can_restart: (bool) = false, or |_| None,
"--can-restart",
@@ -1326,6 +1330,7 @@ struct Mining {
notify_work: Option<Vec<String>>,
refuse_service_transactions: Option<bool>,
infinite_pending_block: Option<bool>,
max_round_blocks_to_import: Option<usize>,
}
#[derive(Default, Debug, PartialEq, Deserialize)]
@@ -1758,6 +1763,7 @@ mod tests {
arg_notify_work: Some("http://localhost:3001".into()),
flag_refuse_service_transactions: false,
flag_infinite_pending_block: false,
arg_max_round_blocks_to_import: 12usize,
flag_stratum: false,
arg_stratum_interface: "local".to_owned(),
@@ -2029,6 +2035,7 @@ mod tests {
notify_work: None,
refuse_service_transactions: None,
infinite_pending_block: None,
max_round_blocks_to_import: None,
}),
footprint: Some(Footprint {
tracing: Some("on".into()),