From e71b38ff438d56249a1ebd3372ac9147e86442f5 Mon Sep 17 00:00:00 2001 From: bayk Date: Fri, 9 Aug 2024 10:42:33 -0700 Subject: [PATCH] rebase 5.3.X [PATCH 111/142] Do not prompt for password to start owner API (#656) * Do not prompt for password to start owner API It makes no sense to ask for the password if one only wants to initialize the APIs. Asking for the password makes things unnecessarily difficult and insecure in case I, as a system administrator, want to have the APIs running as a system service. * Update wallet_args.rs * Update wallet_args.rs opening wallet if password argument is present --- src/cmd/wallet_args.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/cmd/wallet_args.rs b/src/cmd/wallet_args.rs index 57b1011a3..bb2e16b6b 100644 --- a/src/cmd/wallet_args.rs +++ b/src/cmd/wallet_args.rs @@ -1497,10 +1497,11 @@ where ("recover", _) => open_wallet = false, ("cli", _) => open_wallet = false, ("owner_api", _) => { - // If wallet exists, open it. Otherwise, that's fine too. + // If wallet exists and password is present then open it. Otherwise, that's fine too. let mut wallet_lock = wallet.lock(); let lc = wallet_lock.lc_provider().unwrap(); - open_wallet = lc.wallet_exists(None, wallet_config.wallet_data_dir.as_deref())?; + open_wallet = wallet_args.is_present("pass") + && lc.wallet_exists(None, wallet_config.wallet_data_dir.as_deref())?; } _ => {} }