diff --git a/sn_cli/src/bin/subcommands/wallet/hot_wallet.rs b/sn_cli/src/bin/subcommands/wallet/hot_wallet.rs index e04722c238..cd0c8a12e4 100644 --- a/sn_cli/src/bin/subcommands/wallet/hot_wallet.rs +++ b/sn_cli/src/bin/subcommands/wallet/hot_wallet.rs @@ -35,7 +35,10 @@ use std::{path::Path, str::FromStr}; pub enum WalletCmds { /// Print the wallet address. Address { - /// Optional phrase to use for the wallet deriviation from mnemonic entropy. + /// Optional passphrase to protect the mnemonic, + /// it's not the source of the entropy for the mnemonic generation. + /// The mnemonic+passphrase will be the seed. See detail at + /// `` passphrase: Option, }, /// Print the wallet balance. diff --git a/sn_faucet/src/faucet_server.rs b/sn_faucet/src/faucet_server.rs index ac733148bd..01bb805e5a 100644 --- a/sn_faucet/src/faucet_server.rs +++ b/sn_faucet/src/faucet_server.rs @@ -130,11 +130,20 @@ async fn respond_to_donate_request( transfer_str: String, semaphore: Arc, ) -> std::result::Result { - let faucet_root = get_faucet_data_dir(); - let permit = semaphore.try_acquire(); info!("Got donate request with: {transfer_str}"); + // some rate limiting + if is_wallet_locked() || permit.is_err() { + warn!("Rate limited request due"); + let mut response = Response::new("Rate limited".to_string()); + *response.status_mut() = StatusCode::TOO_MANY_REQUESTS; + + // Either opening the file or locking it failed, indicating rate limiting should occur + return Ok(response); + } + + let faucet_root = get_faucet_data_dir(); let mut wallet = match load_account_wallet_or_create_with_mnemonic(&faucet_root, None) { Ok(wallet) => wallet, Err(_error) => { @@ -146,16 +155,6 @@ async fn respond_to_donate_request( } }; - // some rate limiting - if is_wallet_locked() || permit.is_err() { - warn!("Rate limited request due"); - let mut response = Response::new("Rate limited".to_string()); - *response.status_mut() = StatusCode::TOO_MANY_REQUESTS; - - // Either opening the file or locking it failed, indicating rate limiting should occur - return Ok(response); - } - if let Err(err) = fund_faucet_from_genesis_wallet(&client, &mut wallet).await { eprintln!("Failed to load + fund faucet wallet: {err}"); error!("Failed to load + fund faucet wallet: {err}"); diff --git a/sn_transfers/src/wallet/hot_wallet.rs b/sn_transfers/src/wallet/hot_wallet.rs index 2f60d334b6..9e15f59679 100644 --- a/sn_transfers/src/wallet/hot_wallet.rs +++ b/sn_transfers/src/wallet/hot_wallet.rs @@ -62,7 +62,6 @@ impl HotWallet { /// reloads the wallet from disk. fn reload(&mut self) -> Result<()> { - // placeholder random MainSecretKey to take it out let wallet = Self::load_from_path_and_key(self.watchonly_wallet.wallet_dir(), None)?; if *wallet.key.secret_key() != *self.key.secret_key() {