diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/common/password.cpp | 15 | ||||
-rw-r--r-- | src/daemon/daemon.cpp | 9 | ||||
-rw-r--r-- | src/debug_utilities/object_sizes.cpp | 1 | ||||
-rw-r--r-- | src/p2p/net_node.cpp | 1 | ||||
-rw-r--r-- | src/simplewallet/simplewallet.cpp | 2 | ||||
-rw-r--r-- | src/wallet/wallet_rpc_server.h | 1 |
6 files changed, 25 insertions, 4 deletions
diff --git a/src/common/password.cpp b/src/common/password.cpp index a8d5141dc..b3c51128f 100644 --- a/src/common/password.cpp +++ b/src/common/password.cpp @@ -60,7 +60,7 @@ namespace DWORD mode_old; ::GetConsoleMode(h_cin, &mode_old); - DWORD mode_new = mode_old & ~((hide_input ? ENABLE_ECHO_INPUT : 0) | ENABLE_LINE_INPUT); + DWORD mode_new = mode_old & ~(hide_input ? ENABLE_ECHO_INPUT : 0); ::SetConsoleMode(h_cin, mode_new); bool r = true; @@ -78,7 +78,11 @@ namespace { break; } - else if (ucs2_ch == L'\n' || ucs2_ch == L'\r') + else if (ucs2_ch == L'\r') + { + continue; + } + else if (ucs2_ch == L'\n') { std::cout << std::endl; break; @@ -158,6 +162,13 @@ namespace if (!aPass.empty()) { aPass.pop_back(); + if (!hide_input) + std::cout << "\b\b\b \b\b\b" << std::flush; + } + else + { + if (!hide_input) + std::cout << "\b\b \b\b" << std::flush; } } else diff --git a/src/daemon/daemon.cpp b/src/daemon/daemon.cpp index ea24e32eb..f53649518 100644 --- a/src/daemon/daemon.cpp +++ b/src/daemon/daemon.cpp @@ -136,7 +136,14 @@ bool t_daemon::run(bool interactive) { throw std::runtime_error{"Can't run stopped daemon"}; } - tools::signal_handler::install(std::bind(&daemonize::t_daemon::stop_p2p, this)); + + std::atomic<bool> stop(false); + boost::thread([&stop, this] { + while (!stop) + epee::misc_utils::sleep_no_w(100); + this->stop_p2p(); + }).detach(); + tools::signal_handler::install([&stop](int){ stop = true; }); try { diff --git a/src/debug_utilities/object_sizes.cpp b/src/debug_utilities/object_sizes.cpp index ab8839636..2281d0734 100644 --- a/src/debug_utilities/object_sizes.cpp +++ b/src/debug_utilities/object_sizes.cpp @@ -29,6 +29,7 @@ #include <map> #include "cryptonote_basic/cryptonote_basic.h" #include "cryptonote_basic/tx_extra.h" +#include "cryptonote_core/cryptonote_core.h" #include "cryptonote_core/blockchain.h" #include "p2p/p2p_protocol_defs.h" #include "net/connection_basic.hpp" diff --git a/src/p2p/net_node.cpp b/src/p2p/net_node.cpp index c9ca63f43..e9d2061e8 100644 --- a/src/p2p/net_node.cpp +++ b/src/p2p/net_node.cpp @@ -29,6 +29,7 @@ // Parts of this file are originally copyright (c) 2012-2013 The Cryptonote developers #include "common/command_line.h" +#include "cryptonote_core/cryptonote_core.h" #include "net_node.h" namespace nodetool diff --git a/src/simplewallet/simplewallet.cpp b/src/simplewallet/simplewallet.cpp index 4ec7e3eb4..e1a98135c 100644 --- a/src/simplewallet/simplewallet.cpp +++ b/src/simplewallet/simplewallet.cpp @@ -3032,7 +3032,7 @@ bool simple_wallet::init(const boost::program_options::variables_map& vm) return false; } crypto::secret_key viewkey; - if (viewkey_string.hex_to_pod(unwrap(unwrap(viewkey)))) + if (!viewkey_string.hex_to_pod(unwrap(unwrap(viewkey)))) { fail_msg_writer() << tr("failed to parse view key secret key"); return false; diff --git a/src/wallet/wallet_rpc_server.h b/src/wallet/wallet_rpc_server.h index ab896aa3b..35ea11902 100644 --- a/src/wallet/wallet_rpc_server.h +++ b/src/wallet/wallet_rpc_server.h @@ -35,6 +35,7 @@ #include <string> #include "common/util.h" #include "net/http_server_impl_base.h" +#include "math_helper.h" #include "wallet_rpc_server_commands_defs.h" #include "wallet2.h" |