diff --git a/rust-lightclient/src/commands.rs b/rust-lightclient/src/commands.rs index 6e8704c..35b3632 100644 --- a/rust-lightclient/src/commands.rs +++ b/rust-lightclient/src/commands.rs @@ -92,7 +92,7 @@ impl Command for SendCommand { fn exec(&self, args: &[&str], lightclient: &mut LightClient) { // Parse the args. // 1 - Destination address. T or Z address - if args.len() != 3 { + if args.len() < 2 || args.len() > 3 { self.help(); return; } @@ -105,8 +105,10 @@ impl Command for SendCommand { return; } }; + + let memo = if args.len() == 3 { Some(args[2].to_string()) } else {None}; - lightclient.do_send(args[0], value, Some(args[2].to_string())); + lightclient.do_send(args[0], value, memo); } }