Skip to content

Commit

Permalink
System exit on mnemonic failure
Browse files Browse the repository at this point in the history
  • Loading branch information
grarco authored and Gianmarco Fraccaroli committed Nov 17, 2022
1 parent 527850f commit e84452c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions phase2-coordinator/src/io.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use std::{fmt::Display, io::Write, ops::Deref};
use std::{fmt::Display, io::Write, ops::Deref, process};

use crate::authentication::KeyPair;
use bip39::{Language, Mnemonic};
Expand Down Expand Up @@ -246,7 +246,7 @@ fn check_mnemonic(mnemonic: &Mnemonic) -> Result<()> {
} else {
if attempt == 2 {
eprintln!("{}", "Expected: {}, answer: {}\nRun out of attempts for the mnemonic check. Client will shutdown, you'll need to restart the CLI".red().bold(), mnemonic_slice[i], response);
return Err(IOError::CheckMnemonicError);
process::exit(1);
} else {
println!("{}", "Wrong answer, retry".red());
}
Expand Down

0 comments on commit e84452c

Please sign in to comment.