diff --git a/src/subcommand/wallet/batch_command.rs b/src/subcommand/wallet/batch_command.rs index b5fd837499..2cb2f53074 100644 --- a/src/subcommand/wallet/batch_command.rs +++ b/src/subcommand/wallet/batch_command.rs @@ -47,6 +47,7 @@ impl Batch { mode: batchfile.mode, no_backup: self.shared.no_backup, no_limit: self.shared.no_limit, + no_wait: self.shared.no_wait, parent_info, postages, reinscribe: batchfile.reinscribe, diff --git a/src/subcommand/wallet/inscribe.rs b/src/subcommand/wallet/inscribe.rs index 24cf80a7de..8d321534ad 100644 --- a/src/subcommand/wallet/inscribe.rs +++ b/src/subcommand/wallet/inscribe.rs @@ -81,6 +81,7 @@ impl Inscribe { mode: batch::Mode::SeparateOutputs, no_backup: self.shared.no_backup, no_limit: self.shared.no_limit, + no_wait: self.shared.no_wait, parent_info: wallet.get_parent_info(self.parent)?, postages: vec![self.postage.unwrap_or(TARGET_POSTAGE)], reinscribe: self.reinscribe, diff --git a/src/subcommand/wallet/resume.rs b/src/subcommand/wallet/resume.rs index d844591b50..d0d6879a5d 100644 --- a/src/subcommand/wallet/resume.rs +++ b/src/subcommand/wallet/resume.rs @@ -10,7 +10,7 @@ pub(crate) fn run(wallet: Wallet) -> SubcommandResult { .pending_etchings()? .into_iter() .map(|(rune, entry)| { - wallet.wait_for_maturation(&rune, entry.commit, entry.reveal, entry.output) + wallet.wait_for_maturation(&rune, entry.commit, entry.reveal, entry.output, false) }) .collect(); diff --git a/src/subcommand/wallet/shared_args.rs b/src/subcommand/wallet/shared_args.rs index e9db3b5cb7..6733bbc797 100644 --- a/src/subcommand/wallet/shared_args.rs +++ b/src/subcommand/wallet/shared_args.rs @@ -21,4 +21,6 @@ pub(super) struct SharedArgs { help = "Do not check that transactions are equal to or below the MAX_STANDARD_TX_WEIGHT of 400,000 weight units. Transactions over this limit are currently nonstandard and will not be relayed by bitcoind in its default configuration. Do not use this flag unless you understand the implications." )] pub(crate) no_limit: bool, + #[arg(long, alias = "nowait", help = "Do not wait for etching to mature.")] + pub(crate) no_wait: bool, } diff --git a/src/wallet.rs b/src/wallet.rs index 121f6089dd..4013dd5cc9 100644 --- a/src/wallet.rs +++ b/src/wallet.rs @@ -302,13 +302,14 @@ impl Wallet { commit: Transaction, reveal: Transaction, output: batch::Output, + no_wait: bool, ) -> Result { eprintln!("Waiting for rune commitment {} to matureā€¦", commit.txid()); self.save_etching(rune, &commit, &reveal, output.clone())?; loop { - if SHUTTING_DOWN.load(atomic::Ordering::Relaxed) { + if SHUTTING_DOWN.load(atomic::Ordering::Relaxed) || no_wait { eprintln!("Suspending batch. Run `ord wallet resume` to continue."); return Ok(output); } diff --git a/src/wallet/batch/plan.rs b/src/wallet/batch/plan.rs index 26244fe31f..3d7e35f524 100644 --- a/src/wallet/batch/plan.rs +++ b/src/wallet/batch/plan.rs @@ -9,6 +9,7 @@ pub struct Plan { pub(crate) mode: Mode, pub(crate) no_backup: bool, pub(crate) no_limit: bool, + pub(crate) no_wait: bool, pub(crate) parent_info: Option, pub(crate) postages: Vec, pub(crate) reinscribe: bool, @@ -28,6 +29,7 @@ impl Default for Plan { mode: Mode::SharedOutput, no_backup: false, no_limit: false, + no_wait: false, parent_info: None, postages: vec![Amount::from_sat(10_000)], reinscribe: false, @@ -151,6 +153,7 @@ impl Plan { self.inscriptions.clone(), rune.clone(), ), + self.no_wait, )?))) } else { let reveal = match wallet