Skip to content

Commit

Permalink
Merge pull request #16 from mwcproject/5.3.100
Browse files Browse the repository at this point in the history
Handle http node client without urls. Report unlock errors with details.
  • Loading branch information
bayk authored Sep 20, 2024
2 parents 10906eb + e772226 commit f07b562
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 40 deletions.
74 changes: 37 additions & 37 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions src/common/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ pub enum Error {
InvalidNumOutputs(String),
#[error("invalid slate version given: `{0}`")]
InvalidSlateVersion(String),
#[error("could not unlock wallet! are you using the correct passphrase?")]
WalletUnlockFailed,
#[error("could not unlock wallet! {0}")]
WalletUnlockFailed(String),
#[error("Zero-conf Transactions are not allowed. Must have at least 1 confirmation.")]
ZeroConfNotAllowed,
#[error("The wallet is locked. Please use `unlock` first.")]
Expand Down
7 changes: 6 additions & 1 deletion src/wallet/wallet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,12 @@ impl Wallet {
self.create_wallet_instance(config, account, passphrase)
.map_err(|e| {
warn!("Unable to unlock wallet, {}", e);
Error::WalletUnlockFailed
let mut err_str = format!("{}", e);
if err_str.contains("check password?") {
err_str = "are you using the correct passphrase?".to_string(); // magic phrase that is expected by QT wallet
}

Error::WalletUnlockFailed( err_str )
})?;
Ok(())
}
Expand Down

0 comments on commit f07b562

Please sign in to comment.