aboutsummaryrefslogtreecommitdiff
path: root/src/daemon/daemon.cpp
diff options
context:
space:
mode:
authorRiccardo Spagni <ric@spagni.net>2019-03-17 17:56:04 +0200
committerRiccardo Spagni <ric@spagni.net>2019-03-17 17:56:04 +0200
commit848591c4d85ae73c42b3317d9dab192267bc2737 (patch)
tree49609ee8a89b8e475ba610c6af08507aea9ac9bb /src/daemon/daemon.cpp
parentMerge pull request #5185 (diff)
parentdaemon: add --public-node mode, RPC port propagation over P2P (diff)
downloadmonero-848591c4d85ae73c42b3317d9dab192267bc2737.tar.xz
Merge pull request #5190
551104fb daemon: add --public-node mode, RPC port propagation over P2P (xiphon)
Diffstat (limited to 'src/daemon/daemon.cpp')
-rw-r--r--src/daemon/daemon.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/daemon/daemon.cpp b/src/daemon/daemon.cpp
index d31468ff3..3d1d893ea 100644
--- a/src/daemon/daemon.cpp
+++ b/src/daemon/daemon.cpp
@@ -96,9 +96,11 @@ void t_daemon::init_options(boost::program_options::options_description & option
}
t_daemon::t_daemon(
- boost::program_options::variables_map const & vm
+ boost::program_options::variables_map const & vm,
+ uint16_t public_rpc_port
)
- : mp_internals{new t_internals{vm}}
+ : mp_internals{new t_internals{vm}},
+ public_rpc_port(public_rpc_port)
{
zmq_rpc_bind_port = command_line::get_arg(vm, daemon_args::arg_zmq_rpc_bind_port);
zmq_rpc_bind_address = command_line::get_arg(vm, daemon_args::arg_zmq_rpc_bind_ip);
@@ -186,6 +188,12 @@ bool t_daemon::run(bool interactive)
MINFO(std::string("ZMQ server started at ") + zmq_rpc_bind_address
+ ":" + zmq_rpc_bind_port + ".");
+ if (public_rpc_port > 0)
+ {
+ MGINFO("Public RPC port " << public_rpc_port << " will be advertised to other peers over P2P");
+ mp_internals->p2p.get().set_rpc_port(public_rpc_port);
+ }
+
mp_internals->p2p.run(); // blocks until p2p goes down
if (rpc_commands)