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.
This commit is contained in:
Thomas Winget
2015-03-27 08:01:30 -04:00
parent cd31ea9631
commit a0590d29cd
16 changed files with 512 additions and 162 deletions

View File

@@ -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;