From d8075dae281b7600581eebaa521e5608264e7cac Mon Sep 17 00:00:00 2001 From: Aditya Kulkarni Date: Tue, 22 Oct 2019 12:56:29 -0700 Subject: [PATCH] Add proper error for lock --- lib/src/commands.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/src/commands.rs b/lib/src/commands.rs index e0e4c72..eb0f270 100644 --- a/lib/src/commands.rs +++ b/lib/src/commands.rs @@ -356,7 +356,11 @@ impl Command for LockCommand { fn exec(&self, args: &[&str], lightclient: &LightClient) -> String { if args.len() != 0 { - return self.help(); + let mut h = vec![]; + h.push("Extra arguments to lock. Did you mean 'encrypt'?"); + h.push(""); + + return format!("{}\n{}", h.join("\n"), self.help()); } match lightclient.wallet.write().unwrap().lock() {