Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/commands/wallet/init.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ use age::secrecy::ExposeSecret;
use bip0039::{Count, English, Mnemonic};
use clap::Args;
use secrecy::{ExposeSecret as _, SecretString, SecretVec, Zeroize};
use std::io::{stdin, stdout};
use tokio::io::AsyncWriteExt;
use tonic::transport::Channel;

Expand Down Expand Up @@ -85,7 +86,9 @@ impl Command {
};

// Parse or create the wallet's mnemonic phrase.
let phrase = SecretString::new(rpassword::prompt_password(
let phrase = SecretString::new(rpassword::prompt_password_from_bufread(
&mut stdin().lock(),
&mut stdout(),
"Enter mnemonic (or just press Enter to generate a new one):",
)?);
let (mnemonic, recover_until) = if !phrase.expose_secret().is_empty() {
Expand Down