aboutsummaryrefslogtreecommitdiff
path: root/src/daemon/daemon.cpp
diff options
context:
space:
mode:
authorThomas Winget <tewinget@gmail.com>2015-03-27 08:01:30 -0400
committerThomas Winget <tewinget@gmail.com>2015-03-27 08:01:30 -0400
commita0590d29cd9949c65a4cd67630a84410a30d33fe (patch)
tree4e87da719ff11ccfa61798f3bd07d42574cc9c22 /src/daemon/daemon.cpp
parentMerge pull request #247 (diff)
downloadmonero-a0590d29cd9949c65a4cd67630a84410a30d33fe.tar.xz
Restore daemon interactive mode
Daemon interactive mode is now working again. RPC mapped calls in daemon and wallet have both had connection_context removed as an argument as that argument was not being used anywhere.
Diffstat (limited to 'src/daemon/daemon.cpp')
-rw-r--r--src/daemon/daemon.cpp20
1 files changed, 18 insertions, 2 deletions
diff --git a/src/daemon/daemon.cpp b/src/daemon/daemon.cpp
index 728b239a0..ec12c281c 100644
--- a/src/daemon/daemon.cpp
+++ b/src/daemon/daemon.cpp
@@ -35,6 +35,7 @@
#include "daemon/p2p.h"
#include "daemon/protocol.h"
#include "daemon/rpc.h"
+#include "daemon/command_server.h"
#include "misc_log_ex.h"
#include "version.h"
#include <boost/program_options.hpp>
@@ -101,7 +102,7 @@ t_daemon & t_daemon::operator=(t_daemon && other)
return *this;
}
-bool t_daemon::run()
+bool t_daemon::run(bool interactive)
{
if (nullptr == mp_internals)
{
@@ -113,7 +114,22 @@ bool t_daemon::run()
{
mp_internals->core.run();
mp_internals->rpc.run();
- mp_internals->p2p.run();
+
+ daemonize::t_command_server* rpc_commands;
+
+ if (interactive)
+ {
+ rpc_commands = new daemonize::t_command_server(0, 0, false, mp_internals->rpc.get_server());
+ rpc_commands->start_handling();
+ }
+
+ mp_internals->p2p.run(); // blocks until p2p goes down
+
+ if (interactive)
+ {
+ rpc_commands->stop_handling();
+ }
+
mp_internals->rpc.stop();
LOG_PRINT("Node stopped.", LOG_LEVEL_0);
return true;