aboutsummaryrefslogtreecommitdiff
path: root/src/daemon/daemon.cpp
diff options
context:
space:
mode:
authorxiphon <xiphon@protonmail.com>2019-02-24 08:47:49 +0000
committerxiphon <xiphon@protonmail.com>2019-02-25 02:40:23 +0300
commit551104fbf1d2d82cad57d5ea240d1b7be2810ea1 (patch)
treef6ee718c60963bab82468c577f1705eef54b7768 /src/daemon/daemon.cpp
parentMerge pull request #4988 (diff)
downloadmonero-551104fbf1d2d82cad57d5ea240d1b7be2810ea1.tar.xz
daemon: add --public-node mode, RPC port propagation over P2P
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 88fba8372..6a4da748e 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)