aboutsummaryrefslogtreecommitdiff
path: root/src/daemon
diff options
context:
space:
mode:
authorRiccardo Spagni <ric@spagni.net>2017-11-14 21:31:50 +0200
committerRiccardo Spagni <ric@spagni.net>2017-11-14 21:31:51 +0200
commitedebe4e3b603fc391c698bf4d291336ba9376665 (patch)
tree53d687f5767f456284607ffa8e2808b251f2d7a0 /src/daemon
parentMerge pull request #2644 (diff)
parentDo not build against epee_readline if it was not built (diff)
downloadmonero-edebe4e3b603fc391c698bf4d291336ba9376665.tar.xz
Merge pull request #2736
0d9c0db9 Do not build against epee_readline if it was not built (Howard Chu) 178014c9 split off readline code into epee_readline (moneromooo-monero) a9e14a19 link against readline only for monerod and wallet-wallet-{rpc,cli} (moneromooo-monero) 437421ce wallet: move some scoped_message_writer calls from the libs (moneromooo-monero) e89994e9 wallet: rejig to avoid prompting in wallet2 (moneromooo-monero) ec5135e5 move input_line from command_line to simplewallet (moneromooo-monero) 082db75f move cryptonote command line options to cryptonote_core (moneromooo-monero)
Diffstat (limited to 'src/daemon')
-rw-r--r--src/daemon/CMakeLists.txt3
-rw-r--r--src/daemon/daemon.cpp2
-rw-r--r--src/daemon/main.cpp14
3 files changed, 12 insertions, 7 deletions
diff --git a/src/daemon/CMakeLists.txt b/src/daemon/CMakeLists.txt
index d0fc1d846..2f9c2b2f9 100644
--- a/src/daemon/CMakeLists.txt
+++ b/src/daemon/CMakeLists.txt
@@ -94,6 +94,8 @@ target_link_libraries(daemon
daemonizer
serialization
daemon_rpc_server
+ epee
+ ${EPEE_READLINE}
version
${Boost_CHRONO_LIBRARY}
${Boost_FILESYSTEM_LIBRARY}
@@ -102,6 +104,7 @@ target_link_libraries(daemon
${Boost_SYSTEM_LIBRARY}
${CMAKE_THREAD_LIBS_INIT}
${ZMQ_LIB}
+ ${Readline_LIBRARY}
${EXTRA_LIBRARIES})
set_property(TARGET daemon
PROPERTY
diff --git a/src/daemon/daemon.cpp b/src/daemon/daemon.cpp
index faa620c54..cf7d5f8ab 100644
--- a/src/daemon/daemon.cpp
+++ b/src/daemon/daemon.cpp
@@ -88,7 +88,7 @@ t_daemon::t_daemon(
)
: mp_internals{new t_internals{vm}}
{
- bool testnet = command_line::get_arg(vm, command_line::arg_testnet_on);
+ bool testnet = command_line::get_arg(vm, cryptonote::arg_testnet_on);
if (testnet)
{
zmq_rpc_bind_port = command_line::get_arg(vm, daemon_args::arg_zmq_testnet_rpc_bind_port);
diff --git a/src/daemon/main.cpp b/src/daemon/main.cpp
index 5d548f410..ae83943b6 100644
--- a/src/daemon/main.cpp
+++ b/src/daemon/main.cpp
@@ -82,7 +82,6 @@ int main(int argc, char const * argv[])
command_line::add_arg(visible_options, daemon_args::arg_os_version);
bf::path default_conf = default_data_dir / std::string(CRYPTONOTE_NAME ".conf");
command_line::add_arg(visible_options, daemon_args::arg_config_file, default_conf.string());
- command_line::add_arg(visible_options, command_line::arg_test_dbg_lock_sleep);
// Settings
bf::path default_log = default_data_dir / std::string(CRYPTONOTE_NAME ".log");
@@ -144,8 +143,6 @@ int main(int argc, char const * argv[])
return 0;
}
- epee::debug::g_test_dbg_lock_sleep() = command_line::get_arg(vm, command_line::arg_test_dbg_lock_sleep);
-
std::string db_type = command_line::get_arg(vm, cryptonote::arg_db_type);
// verify that blockchaindb type is valid
@@ -156,9 +153,9 @@ int main(int argc, char const * argv[])
return 0;
}
- bool testnet_mode = command_line::get_arg(vm, command_line::arg_testnet_on);
+ bool testnet_mode = command_line::get_arg(vm, cryptonote::arg_testnet_on);
- auto data_dir_arg = testnet_mode ? command_line::arg_testnet_data_dir : command_line::arg_data_dir;
+ auto data_dir_arg = testnet_mode ? cryptonote::arg_testnet_data_dir : cryptonote::arg_data_dir;
// data_dir
// default: e.g. ~/.bitmonero/ or ~/.bitmonero/testnet
@@ -250,7 +247,12 @@ int main(int argc, char const * argv[])
if (command_line::has_arg(vm, arg.rpc_login))
{
login = tools::login::parse(
- command_line::get_arg(vm, arg.rpc_login), false, "Daemon client password"
+ command_line::get_arg(vm, arg.rpc_login), false, [](bool verify) {
+#ifdef HAVE_READLINE
+ rdln::suspend_readline pause_readline;
+#endif
+ return tools::password_container::prompt(verify, "Daemon client password");
+ }
);
if (!login)
{