aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRiccardo Spagni <ric@spagni.net>2017-08-15 20:49:26 +0200
committerRiccardo Spagni <ric@spagni.net>2017-08-15 20:49:26 +0200
commit718941bee03fc7bbfebf2ceb9a6ac3bae25fec6d (patch)
treea31980fcd8dee263da08e90902b267d16b851dcd
parentMerge pull request #2255 (diff)
parentsimplewallet: do not ask wallet filename twice when restoring (diff)
downloadmonero-718941bee03fc7bbfebf2ceb9a6ac3bae25fec6d.tar.xz
Merge pull request #2256
042b86c4 simplewallet: do not ask wallet filename twice when restoring (moneromooo-monero)
-rw-r--r--src/simplewallet/simplewallet.cpp17
1 files changed, 11 insertions, 6 deletions
diff --git a/src/simplewallet/simplewallet.cpp b/src/simplewallet/simplewallet.cpp
index 3b4c8a614..aa9fe2bca 100644
--- a/src/simplewallet/simplewallet.cpp
+++ b/src/simplewallet/simplewallet.cpp
@@ -919,14 +919,19 @@ bool simple_wallet::ask_wallet_create_if_needed()
}
else if(!wallet_file_exists && !keys_file_exists) //No wallet, no keys
{
- message_writer() << tr(m_restoring ? "Confirm wallet name: " : "No wallet found with that name. Confirm creation of new wallet named: ") << wallet_path;
- confirm_creation = command_line::input_line(tr("(Y/Yes/N/No): "));
- if(std::cin.eof())
+ bool ok = true;
+ if (!m_restoring)
{
- LOG_ERROR("Unexpected std::cin.eof() - Exited simple_wallet::ask_wallet_create_if_needed()");
- return false;
+ message_writer() << tr("No wallet found with that name. Confirm creation of new wallet named: ") << wallet_path;
+ confirm_creation = command_line::input_line(tr("(Y/Yes/N/No): "));
+ if(std::cin.eof())
+ {
+ LOG_ERROR("Unexpected std::cin.eof() - Exited simple_wallet::ask_wallet_create_if_needed()");
+ return false;
+ }
+ ok = command_line::is_yes(confirm_creation);
}
- if(command_line::is_yes(confirm_creation))
+ if (ok)
{
success_msg_writer() << tr("Generating new wallet...");
m_generate_new = wallet_path;