aboutsummaryrefslogtreecommitdiff
path: root/src/rpc
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/rpc
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/rpc')
-rw-r--r--src/rpc/core_rpc_server.cpp8
-rw-r--r--src/rpc/core_rpc_server.h1
-rw-r--r--src/rpc/core_rpc_server_commands_defs.h12
-rw-r--r--src/rpc/message_data_structs.h1
4 files changed, 13 insertions, 9 deletions
diff --git a/src/rpc/core_rpc_server.cpp b/src/rpc/core_rpc_server.cpp
index 6357f84b1..ff55167fe 100644
--- a/src/rpc/core_rpc_server.cpp
+++ b/src/rpc/core_rpc_server.cpp
@@ -969,9 +969,9 @@ namespace cryptonote
{
if (entry.adr.get_type_id() == epee::net_utils::ipv4_network_address::get_type_id())
res.white_list.emplace_back(entry.id, entry.adr.as<epee::net_utils::ipv4_network_address>().ip(),
- entry.adr.as<epee::net_utils::ipv4_network_address>().port(), entry.last_seen, entry.pruning_seed);
+ entry.adr.as<epee::net_utils::ipv4_network_address>().port(), entry.last_seen, entry.pruning_seed, entry.rpc_port);
else
- res.white_list.emplace_back(entry.id, entry.adr.str(), entry.last_seen, entry.pruning_seed);
+ res.white_list.emplace_back(entry.id, entry.adr.str(), entry.last_seen, entry.pruning_seed, entry.rpc_port);
}
res.gray_list.reserve(gray_list.size());
@@ -979,9 +979,9 @@ namespace cryptonote
{
if (entry.adr.get_type_id() == epee::net_utils::ipv4_network_address::get_type_id())
res.gray_list.emplace_back(entry.id, entry.adr.as<epee::net_utils::ipv4_network_address>().ip(),
- entry.adr.as<epee::net_utils::ipv4_network_address>().port(), entry.last_seen, entry.pruning_seed);
+ entry.adr.as<epee::net_utils::ipv4_network_address>().port(), entry.last_seen, entry.pruning_seed, entry.rpc_port);
else
- res.gray_list.emplace_back(entry.id, entry.adr.str(), entry.last_seen, entry.pruning_seed);
+ res.gray_list.emplace_back(entry.id, entry.adr.str(), entry.last_seen, entry.pruning_seed, entry.rpc_port);
}
res.status = CORE_RPC_STATUS_OK;
diff --git a/src/rpc/core_rpc_server.h b/src/rpc/core_rpc_server.h
index bcc5f1470..fe066b31b 100644
--- a/src/rpc/core_rpc_server.h
+++ b/src/rpc/core_rpc_server.h
@@ -53,6 +53,7 @@ namespace cryptonote
{
public:
+ static const command_line::arg_descriptor<bool> arg_public_node;
static const command_line::arg_descriptor<std::string, false, true, 2> arg_rpc_bind_port;
static const command_line::arg_descriptor<std::string> arg_rpc_restricted_bind_port;
static const command_line::arg_descriptor<bool> arg_restricted_rpc;
diff --git a/src/rpc/core_rpc_server_commands_defs.h b/src/rpc/core_rpc_server_commands_defs.h
index 7ee25ca85..f65c7c8dd 100644
--- a/src/rpc/core_rpc_server_commands_defs.h
+++ b/src/rpc/core_rpc_server_commands_defs.h
@@ -84,7 +84,7 @@ namespace cryptonote
// advance which version they will stop working with
// Don't go over 32767 for any of these
#define CORE_RPC_VERSION_MAJOR 2
-#define CORE_RPC_VERSION_MINOR 3
+#define CORE_RPC_VERSION_MINOR 4
#define MAKE_CORE_RPC_VERSION(major,minor) (((major)<<16)|(minor))
#define CORE_RPC_VERSION MAKE_CORE_RPC_VERSION(CORE_RPC_VERSION_MAJOR, CORE_RPC_VERSION_MINOR)
@@ -1386,16 +1386,17 @@ namespace cryptonote
std::string host;
uint32_t ip;
uint16_t port;
+ uint16_t rpc_port;
uint64_t last_seen;
uint32_t pruning_seed;
peer() = default;
- peer(uint64_t id, const std::string &host, uint64_t last_seen, uint32_t pruning_seed)
- : id(id), host(host), ip(0), port(0), last_seen(last_seen), pruning_seed(pruning_seed)
+ peer(uint64_t id, const std::string &host, uint64_t last_seen, uint32_t pruning_seed, uint16_t rpc_port)
+ : id(id), host(host), ip(0), port(0), rpc_port(rpc_port), last_seen(last_seen), pruning_seed(pruning_seed)
{}
- peer(uint64_t id, uint32_t ip, uint16_t port, uint64_t last_seen, uint32_t pruning_seed)
- : id(id), host(std::to_string(ip)), ip(ip), port(port), last_seen(last_seen), pruning_seed(pruning_seed)
+ peer(uint64_t id, uint32_t ip, uint16_t port, uint64_t last_seen, uint32_t pruning_seed, uint16_t rpc_port)
+ : id(id), host(std::to_string(ip)), ip(ip), port(port), rpc_port(rpc_port), last_seen(last_seen), pruning_seed(pruning_seed)
{}
BEGIN_KV_SERIALIZE_MAP()
@@ -1403,6 +1404,7 @@ namespace cryptonote
KV_SERIALIZE(host)
KV_SERIALIZE(ip)
KV_SERIALIZE(port)
+ KV_SERIALIZE_OPT(rpc_port, (uint16_t)0)
KV_SERIALIZE(last_seen)
KV_SERIALIZE_OPT(pruning_seed, (uint32_t)0)
END_KV_SERIALIZE_MAP()
diff --git a/src/rpc/message_data_structs.h b/src/rpc/message_data_structs.h
index 8b5e02417..26c5038f6 100644
--- a/src/rpc/message_data_structs.h
+++ b/src/rpc/message_data_structs.h
@@ -78,6 +78,7 @@ namespace rpc
uint64_t id;
uint32_t ip;
uint16_t port;
+ uint16_t rpc_port;
uint64_t last_seen;
uint32_t pruning_seed;
};