Skip to content
Permalink
Browse files

wallet: fix memory only wallets

at least when using restore_deterministic_wallet
  • Loading branch information...
moneromooo-monero committed Mar 15, 2019
1 parent 1d1a02e commit b30c98cacfbf960a78255f71217deb26ab9c3591
Showing with 5 additions and 9 deletions.
  1. +2 −1 src/wallet/wallet2.cpp
  2. +3 −8 src/wallet/wallet_rpc_server.cpp
@@ -3455,7 +3455,8 @@ void wallet2::change_password(const std::string &filename, const epee::wipeable_
decrypt_keys(original_password);
setup_keys(new_password);
rewrite(filename, new_password);
store();
if (!filename.empty())
store();
}
//----------------------------------------------------------------------------------------------------
/*!
@@ -3187,12 +3187,6 @@ namespace tools
}

// early check for mandatory fields
if (req.filename.empty())
{
er.code = WALLET_RPC_ERROR_CODE_UNKNOWN_ERROR;
er.message = "field 'filename' is mandatory. Please provide a filename to save the restored wallet to.";
return false;
}
if (req.seed.empty())
{
er.code = WALLET_RPC_ERROR_CODE_UNKNOWN_ERROR;
@@ -3215,7 +3209,7 @@ namespace tools
er.message = "Invalid filename";
return false;
}
std::string wallet_file = m_wallet_dir + "/" + req.filename;
std::string wallet_file = req.filename.empty() ? "" : (m_wallet_dir + "/" + req.filename);
// check if wallet file already exists
if (!wallet_file.empty())
{
@@ -3356,7 +3350,8 @@ namespace tools
{
try
{
m_wallet->store();
if (!wallet_file.empty())
m_wallet->store();
}
catch (const std::exception &e)
{

0 comments on commit b30c98c

Please sign in to comment.
You can’t perform that action at this time.