mirror of
https://github.com/mimblewimble/grin.git
synced 2025-02-01 17:01:09 +03:00
Wallet command exit status on error (#1253)
This commit is contained in:
parent
bdfd5405c0
commit
12a2fc4f5a
1 changed files with 133 additions and 131 deletions
|
@ -659,13 +659,12 @@ fn wallet_command(wallet_args: &ArgMatches, global_config: GlobalConfig) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Handle single-use (command line) owner commands
|
// Handle single-use (command line) owner commands
|
||||||
{
|
|
||||||
let wallet = Arc::new(Mutex::new(instantiate_wallet(
|
let wallet = Arc::new(Mutex::new(instantiate_wallet(
|
||||||
wallet_config.clone(),
|
wallet_config.clone(),
|
||||||
passphrase,
|
passphrase,
|
||||||
use_db,
|
use_db,
|
||||||
)));
|
)));
|
||||||
let _res = wallet::controller::owner_single_use(wallet, |api| {
|
let res = wallet::controller::owner_single_use(wallet, |api| {
|
||||||
match wallet_args.subcommand() {
|
match wallet_args.subcommand() {
|
||||||
("send", Some(send_args)) => {
|
("send", Some(send_args)) => {
|
||||||
let amount = send_args
|
let amount = send_args
|
||||||
|
@ -795,7 +794,10 @@ fn wallet_command(wallet_args: &ArgMatches, global_config: GlobalConfig) {
|
||||||
_ => panic!("Unknown wallet command, use 'grin help wallet' for details"),
|
_ => panic!("Unknown wallet command, use 'grin help wallet' for details"),
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
|
||||||
// we need to give log output a chance to catch up before exiting
|
// we need to give log output a chance to catch up before exiting
|
||||||
thread::sleep(Duration::from_millis(100));
|
thread::sleep(Duration::from_millis(100));
|
||||||
|
|
||||||
|
if res.is_err() {
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue