diff --git a/src/main.rs b/src/main.rs index 5e7a257c..ad58442b 100644 --- a/src/main.rs +++ b/src/main.rs @@ -953,7 +953,9 @@ async fn main_internal() -> Result<(), PaymentError> { &conn.clone().unwrap(), None, 1, - cleanup_options.chain_id, + cleanup_options.chain_id.ok_or(err_custom_create!( + "Chain id not specified for stuck tx removal" + ))?, ) .await .map_err(err_from!())?; @@ -988,7 +990,9 @@ async fn main_internal() -> Result<(), PaymentError> { &conn.clone().unwrap(), None, 1, - cleanup_options.chain_id, + cleanup_options.chain_id.ok_or(err_custom_create!( + "Chain id not specified for unsafe tx removal" + ))?, ) .await .map_err(err_from!())?; diff --git a/src/options.rs b/src/options.rs index 6f43fddb..03559294 100644 --- a/src/options.rs +++ b/src/options.rs @@ -357,7 +357,7 @@ pub struct CleanupOptions { pub remove_tx_unsafe: bool, #[structopt(long = "chain-id", help = "Chain id to use")] - pub chain_id: i64, + pub chain_id: Option, } #[derive(StructOpt)]