Add CLI option and route to MinerOptions.
This commit is contained in:
@@ -169,6 +169,8 @@ Sealing/Mining Options:
|
||||
more than 32 characters.
|
||||
--tx-queue-size LIMIT Maximum amount of transactions in the queue (waiting
|
||||
to be included in next block) [default: 1024].
|
||||
--notify-work URLS URLs to which work package notifications are pushed.
|
||||
URLS should be a comma-delimited list of HTTP URLs.
|
||||
|
||||
Footprint Options:
|
||||
--tracing BOOL Indicates if full transaction tracing should be
|
||||
@@ -320,6 +322,7 @@ pub struct Args {
|
||||
pub flag_gas_cap: String,
|
||||
pub flag_extra_data: Option<String>,
|
||||
pub flag_tx_queue_size: usize,
|
||||
pub flag_work_notify: Option<String>,
|
||||
pub flag_logging: Option<String>,
|
||||
pub flag_version: bool,
|
||||
pub flag_from: String,
|
||||
|
||||
@@ -84,6 +84,10 @@ impl Configuration {
|
||||
)
|
||||
}
|
||||
|
||||
pub fn work_notify(&self) -> Vec<String> {
|
||||
self.args.flag_work_notify.as_ref().map_or_else(Vec::new, |s| s.split(',').map(|s| s.to_owned()).collect())
|
||||
}
|
||||
|
||||
pub fn miner_options(&self) -> MinerOptions {
|
||||
let (own, ext) = match self.args.flag_reseal_on_txs.as_str() {
|
||||
"none" => (false, false),
|
||||
@@ -93,6 +97,7 @@ impl Configuration {
|
||||
x => die!("{}: Invalid value for --reseal option. Use --help for more information.", x)
|
||||
};
|
||||
MinerOptions {
|
||||
new_work_notify: self.work_notify(),
|
||||
force_sealing: self.args.flag_force_sealing,
|
||||
reseal_on_external_tx: ext,
|
||||
reseal_on_own_tx: own,
|
||||
|
||||
Reference in New Issue
Block a user