aboutsummaryrefslogtreecommitdiff
path: root/src/rpc
diff options
context:
space:
mode:
Diffstat (limited to 'src/rpc')
-rw-r--r--src/rpc/CMakeLists.txt2
-rw-r--r--src/rpc/core_rpc_server.cpp85
-rw-r--r--src/rpc/core_rpc_server.h8
-rw-r--r--src/rpc/core_rpc_server_commands_defs.h403
-rw-r--r--src/rpc/core_rpc_server_error_codes.h2
-rw-r--r--src/rpc/daemon_handler.cpp2
-rw-r--r--src/rpc/daemon_handler.h2
-rw-r--r--src/rpc/daemon_messages.cpp2
-rw-r--r--src/rpc/daemon_messages.h2
-rw-r--r--src/rpc/daemon_rpc_version.h2
-rw-r--r--src/rpc/instanciations.cpp2
-rw-r--r--src/rpc/message.cpp2
-rw-r--r--src/rpc/message.h2
-rw-r--r--src/rpc/message_data_structs.h2
-rw-r--r--src/rpc/rpc_args.cpp2
-rw-r--r--src/rpc/rpc_args.h2
-rw-r--r--src/rpc/rpc_handler.h2
-rw-r--r--src/rpc/zmq_server.cpp2
-rw-r--r--src/rpc/zmq_server.h2
19 files changed, 365 insertions, 163 deletions
diff --git a/src/rpc/CMakeLists.txt b/src/rpc/CMakeLists.txt
index 60cae036c..cffe8e1eb 100644
--- a/src/rpc/CMakeLists.txt
+++ b/src/rpc/CMakeLists.txt
@@ -1,4 +1,4 @@
-# Copyright (c) 2014-2018, The Monero Project
+# Copyright (c) 2014-2019, The Monero Project
#
# All rights reserved.
#
diff --git a/src/rpc/core_rpc_server.cpp b/src/rpc/core_rpc_server.cpp
index bb9768168..6357f84b1 100644
--- a/src/rpc/core_rpc_server.cpp
+++ b/src/rpc/core_rpc_server.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2014-2018, The Monero Project
+// Copyright (c) 2014-2019, The Monero Project
//
// All rights reserved.
//
@@ -65,6 +65,11 @@ namespace
reasons += ", ";
reasons += reason;
}
+
+ uint64_t round_up(uint64_t value, uint64_t quantum)
+ {
+ return (value + quantum - 1) / quantum * quantum;
+ }
}
namespace cryptonote
@@ -76,6 +81,12 @@ namespace cryptonote
command_line::add_arg(desc, arg_rpc_bind_port);
command_line::add_arg(desc, arg_rpc_restricted_bind_port);
command_line::add_arg(desc, arg_restricted_rpc);
+ command_line::add_arg(desc, arg_rpc_ssl);
+ command_line::add_arg(desc, arg_rpc_ssl_private_key);
+ command_line::add_arg(desc, arg_rpc_ssl_certificate);
+ command_line::add_arg(desc, arg_rpc_ssl_allowed_certificates);
+ command_line::add_arg(desc, arg_rpc_ssl_allowed_fingerprints);
+ command_line::add_arg(desc, arg_rpc_ssl_allow_any_cert);
command_line::add_arg(desc, arg_bootstrap_daemon_address);
command_line::add_arg(desc, arg_bootstrap_daemon_login);
cryptonote::rpc_args::init_options(desc);
@@ -112,11 +123,11 @@ namespace cryptonote
epee::net_utils::http::login login;
login.username = bootstrap_daemon_login.substr(0, loc);
login.password = bootstrap_daemon_login.substr(loc + 1);
- m_http_client.set_server(m_bootstrap_daemon_address, login, false);
+ m_http_client.set_server(m_bootstrap_daemon_address, login, epee::net_utils::ssl_support_t::e_ssl_support_autodetect);
}
else
{
- m_http_client.set_server(m_bootstrap_daemon_address, boost::none, false);
+ m_http_client.set_server(m_bootstrap_daemon_address, boost::none, epee::net_utils::ssl_support_t::e_ssl_support_autodetect);
}
m_should_use_bootstrap_daemon = true;
}
@@ -131,9 +142,36 @@ namespace cryptonote
if (rpc_config->login)
http_login.emplace(std::move(rpc_config->login->username), std::move(rpc_config->login->password).password());
+ epee::net_utils::ssl_support_t ssl_support;
+ const std::string ssl = command_line::get_arg(vm, arg_rpc_ssl);
+ if (!epee::net_utils::ssl_support_from_string(ssl_support, ssl))
+ {
+ MFATAL("Invalid RPC SSL support: " << ssl);
+ return false;
+ }
+ const std::string ssl_private_key = command_line::get_arg(vm, arg_rpc_ssl_private_key);
+ const std::string ssl_certificate = command_line::get_arg(vm, arg_rpc_ssl_certificate);
+ const std::vector<std::string> ssl_allowed_certificate_paths = command_line::get_arg(vm, arg_rpc_ssl_allowed_certificates);
+ std::list<std::string> ssl_allowed_certificates;
+ for (const std::string &path: ssl_allowed_certificate_paths)
+ {
+ ssl_allowed_certificates.push_back({});
+ if (!epee::file_io_utils::load_file_to_string(path, ssl_allowed_certificates.back()))
+ {
+ MERROR("Failed to load certificate: " << path);
+ ssl_allowed_certificates.back() = std::string();
+ }
+ }
+
+ const std::vector<std::string> ssl_allowed_fingerprint_strings = command_line::get_arg(vm, arg_rpc_ssl_allowed_fingerprints);
+ std::vector<std::vector<uint8_t>> ssl_allowed_fingerprints{ ssl_allowed_fingerprint_strings.size() };
+ std::transform(ssl_allowed_fingerprint_strings.begin(), ssl_allowed_fingerprint_strings.end(), ssl_allowed_fingerprints.begin(), epee::from_hex::vector);
+ const bool ssl_allow_any_cert = command_line::get_arg(vm, arg_rpc_ssl_allow_any_cert);
+
auto rng = [](size_t len, uint8_t *ptr){ return crypto::rand(len, ptr); };
return epee::http_server_impl_base<core_rpc_server, connection_context>::init(
- rng, std::move(port), std::move(rpc_config->bind_ip), std::move(rpc_config->access_control_origins), std::move(http_login)
+ rng, std::move(port), std::move(rpc_config->bind_ip), std::move(rpc_config->access_control_origins), std::move(http_login),
+ ssl_support, std::make_pair(ssl_private_key, ssl_certificate), std::move(ssl_allowed_certificates), std::move(ssl_allowed_fingerprints), ssl_allow_any_cert
);
}
//------------------------------------------------------------------------------------------------------------------------------
@@ -214,7 +252,9 @@ namespace cryptonote
boost::shared_lock<boost::shared_mutex> lock(m_bootstrap_daemon_mutex);
res.was_bootstrap_ever_used = m_was_bootstrap_ever_used;
}
- res.database_size = restricted ? 0 : m_core.get_blockchain_storage().get_db().get_database_size();
+ res.database_size = m_core.get_blockchain_storage().get_db().get_database_size();
+ if (restricted)
+ res.database_size = round_up(res.database_size, 5ull* 1024 * 1024 * 1024);
res.update_available = restricted ? false : m_core.is_update_available();
res.version = restricted ? "" : MONERO_VERSION;
return true;
@@ -1341,6 +1381,7 @@ namespace cryptonote
response.block_size = response.block_weight = m_core.get_blockchain_storage().get_db().get_block_weight(height);
response.num_txes = blk.tx_hashes.size();
response.pow_hash = fill_pow_hash ? string_tools::pod_to_hex(get_block_longhash(blk, height)) : "";
+ response.long_term_weight = m_core.get_blockchain_storage().get_db().get_block_long_term_weight(height);
return true;
}
//------------------------------------------------------------------------------------------------------------------------------
@@ -2336,6 +2377,40 @@ namespace cryptonote
, false
};
+ const command_line::arg_descriptor<std::string> core_rpc_server::arg_rpc_ssl = {
+ "rpc-ssl"
+ , "Enable SSL on RPC connections: enabled|disabled|autodetect"
+ , "autodetect"
+ };
+
+ const command_line::arg_descriptor<std::string> core_rpc_server::arg_rpc_ssl_private_key = {
+ "rpc-ssl-private-key"
+ , "Path to a PEM format private key"
+ , ""
+ };
+
+ const command_line::arg_descriptor<std::string> core_rpc_server::arg_rpc_ssl_certificate = {
+ "rpc-ssl-certificate"
+ , "Path to a PEM format certificate"
+ , ""
+ };
+
+ const command_line::arg_descriptor<std::vector<std::string>> core_rpc_server::arg_rpc_ssl_allowed_certificates = {
+ "rpc-ssl-allowed-certificates"
+ , "List of paths to PEM format certificates of allowed peers (all allowed if empty)"
+ };
+
+ const command_line::arg_descriptor<std::vector<std::string>> core_rpc_server::arg_rpc_ssl_allowed_fingerprints = {
+ "rpc-ssl-allowed-fingerprints"
+ , "List of certificate fingerprints to allow"
+ };
+
+ const command_line::arg_descriptor<bool> core_rpc_server::arg_rpc_ssl_allow_any_cert = {
+ "rpc-ssl-allow-any-cert"
+ , "Allow any peer certificate, rather than just those on the allowed list"
+ , false
+ };
+
const command_line::arg_descriptor<std::string> core_rpc_server::arg_bootstrap_daemon_address = {
"bootstrap-daemon-address"
, "URL of a 'bootstrap' remote daemon that the connected wallets can use while this daemon is still not fully synced"
diff --git a/src/rpc/core_rpc_server.h b/src/rpc/core_rpc_server.h
index 62a377841..bcc5f1470 100644
--- a/src/rpc/core_rpc_server.h
+++ b/src/rpc/core_rpc_server.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2014-2018, The Monero Project
+// Copyright (c) 2014-2019, The Monero Project
//
// All rights reserved.
//
@@ -56,6 +56,12 @@ namespace cryptonote
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;
+ static const command_line::arg_descriptor<std::string> arg_rpc_ssl;
+ static const command_line::arg_descriptor<std::string> arg_rpc_ssl_private_key;
+ static const command_line::arg_descriptor<std::string> arg_rpc_ssl_certificate;
+ static const command_line::arg_descriptor<std::vector<std::string>> arg_rpc_ssl_allowed_certificates;
+ static const command_line::arg_descriptor<std::vector<std::string>> arg_rpc_ssl_allowed_fingerprints;
+ static const command_line::arg_descriptor<bool> arg_rpc_ssl_allow_any_cert;
static const command_line::arg_descriptor<std::string> arg_bootstrap_daemon_address;
static const command_line::arg_descriptor<std::string> arg_bootstrap_daemon_login;
diff --git a/src/rpc/core_rpc_server_commands_defs.h b/src/rpc/core_rpc_server_commands_defs.h
index 59caa1b9e..7ee25ca85 100644
--- a/src/rpc/core_rpc_server_commands_defs.h
+++ b/src/rpc/core_rpc_server_commands_defs.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2014-2018, The Monero Project
+// Copyright (c) 2014-2019, The Monero Project
//
// All rights reserved.
//
@@ -90,13 +90,14 @@ namespace cryptonote
struct COMMAND_RPC_GET_HEIGHT
{
- struct request
+ struct request_t
{
BEGIN_KV_SERIALIZE_MAP()
END_KV_SERIALIZE_MAP()
};
+ typedef epee::misc_utils::struct_init<request_t> request;
- struct response
+ struct response_t
{
uint64_t height;
std::string status;
@@ -108,12 +109,13 @@ namespace cryptonote
KV_SERIALIZE(untrusted)
END_KV_SERIALIZE_MAP()
};
+ typedef epee::misc_utils::struct_init<response_t> response;
};
struct COMMAND_RPC_GET_BLOCKS_FAST
{
- struct request
+ struct request_t
{
std::list<crypto::hash> block_ids; //*first 10 blocks id goes sequential, next goes in pow(2,n) offset, like 2, 4, 8, 16, 32, 64 and so on, and the last one is always genesis block */
uint64_t start_height;
@@ -126,6 +128,7 @@ namespace cryptonote
KV_SERIALIZE_OPT(no_miner_tx, false)
END_KV_SERIALIZE_MAP()
};
+ typedef epee::misc_utils::struct_init<request_t> request;
struct tx_output_indices
{
@@ -145,7 +148,7 @@ namespace cryptonote
END_KV_SERIALIZE_MAP()
};
- struct response
+ struct response_t
{
std::vector<block_complete_entry> blocks;
uint64_t start_height;
@@ -163,19 +166,21 @@ namespace cryptonote
KV_SERIALIZE(untrusted)
END_KV_SERIALIZE_MAP()
};
+ typedef epee::misc_utils::struct_init<response_t> response;
};
struct COMMAND_RPC_GET_BLOCKS_BY_HEIGHT
{
- struct request
+ struct request_t
{
std::vector<uint64_t> heights;
BEGIN_KV_SERIALIZE_MAP()
KV_SERIALIZE(heights)
END_KV_SERIALIZE_MAP()
};
+ typedef epee::misc_utils::struct_init<request_t> request;
- struct response
+ struct response_t
{
std::vector<block_complete_entry> blocks;
std::string status;
@@ -187,17 +192,19 @@ namespace cryptonote
KV_SERIALIZE(untrusted)
END_KV_SERIALIZE_MAP()
};
+ typedef epee::misc_utils::struct_init<response_t> response;
};
struct COMMAND_RPC_GET_ALT_BLOCKS_HASHES
{
- struct request
+ struct request_t
{
BEGIN_KV_SERIALIZE_MAP()
END_KV_SERIALIZE_MAP()
};
+ typedef epee::misc_utils::struct_init<request_t> request;
- struct response
+ struct response_t
{
std::vector<std::string> blks_hashes;
std::string status;
@@ -209,11 +216,12 @@ namespace cryptonote
KV_SERIALIZE(untrusted)
END_KV_SERIALIZE_MAP()
};
+ typedef epee::misc_utils::struct_init<response_t> response;
};
struct COMMAND_RPC_GET_HASHES_FAST
{
- struct request
+ struct request_t
{
std::list<crypto::hash> block_ids; //*first 10 blocks id goes sequential, next goes in pow(2,n) offset, like 2, 4, 8, 16, 32, 64 and so on, and the last one is always genesis block */
uint64_t start_height;
@@ -222,8 +230,9 @@ namespace cryptonote
KV_SERIALIZE(start_height)
END_KV_SERIALIZE_MAP()
};
+ typedef epee::misc_utils::struct_init<request_t> request;
- struct response
+ struct response_t
{
std::vector<crypto::hash> m_block_ids;
uint64_t start_height;
@@ -239,12 +248,13 @@ namespace cryptonote
KV_SERIALIZE(untrusted)
END_KV_SERIALIZE_MAP()
};
+ typedef epee::misc_utils::struct_init<response_t> response;
};
//-----------------------------------------------
struct COMMAND_RPC_GET_ADDRESS_TXS
{
- struct request
+ struct request_t
{
std::string address;
std::string view_key;
@@ -254,6 +264,7 @@ namespace cryptonote
KV_SERIALIZE(view_key)
END_KV_SERIALIZE_MAP()
};
+ typedef epee::misc_utils::struct_init<request_t> request;
struct spent_output {
uint64_t amount;
@@ -304,7 +315,7 @@ namespace cryptonote
};
- struct response
+ struct response_t
{
//std::list<std::string> txs_as_json;
uint64_t total_received;
@@ -324,12 +335,13 @@ namespace cryptonote
KV_SERIALIZE(status)
END_KV_SERIALIZE_MAP()
};
+ typedef epee::misc_utils::struct_init<response_t> response;
};
//-----------------------------------------------
struct COMMAND_RPC_GET_ADDRESS_INFO
{
- struct request
+ struct request_t
{
std::string address;
std::string view_key;
@@ -339,6 +351,7 @@ namespace cryptonote
KV_SERIALIZE(view_key)
END_KV_SERIALIZE_MAP()
};
+ typedef epee::misc_utils::struct_init<request_t> request;
struct spent_output
{
@@ -356,10 +369,8 @@ namespace cryptonote
KV_SERIALIZE(mixin)
END_KV_SERIALIZE_MAP()
};
-
-
-
- struct response
+
+ struct response_t
{
uint64_t locked_funds;
uint64_t total_received;
@@ -382,12 +393,13 @@ namespace cryptonote
KV_SERIALIZE(spent_outputs)
END_KV_SERIALIZE_MAP()
};
+ typedef epee::misc_utils::struct_init<response_t> response;
};
//-----------------------------------------------
struct COMMAND_RPC_GET_UNSPENT_OUTS
{
- struct request
+ struct request_t
{
std::string amount;
std::string address;
@@ -406,6 +418,7 @@ namespace cryptonote
KV_SERIALIZE(dust_threshold)
END_KV_SERIALIZE_MAP()
};
+ typedef epee::misc_utils::struct_init<request_t> request;
struct output {
@@ -437,7 +450,7 @@ namespace cryptonote
END_KV_SERIALIZE_MAP()
};
- struct response
+ struct response_t
{
uint64_t amount;
std::list<output> outputs;
@@ -452,12 +465,13 @@ namespace cryptonote
KV_SERIALIZE(reason)
END_KV_SERIALIZE_MAP()
};
+ typedef epee::misc_utils::struct_init<response_t> response;
};
//-----------------------------------------------
struct COMMAND_RPC_GET_RANDOM_OUTS
{
- struct request
+ struct request_t
{
std::vector<std::string> amounts;
uint32_t count;
@@ -467,6 +481,7 @@ namespace cryptonote
KV_SERIALIZE(count)
END_KV_SERIALIZE_MAP()
};
+ typedef epee::misc_utils::struct_init<request_t> request;
struct output {
@@ -491,7 +506,7 @@ namespace cryptonote
};
- struct response
+ struct response_t
{
std::vector<amount_out> amount_outs;
std::string Error;
@@ -500,11 +515,12 @@ namespace cryptonote
KV_SERIALIZE(Error)
END_KV_SERIALIZE_MAP()
};
+ typedef epee::misc_utils::struct_init<response_t> response;
};
//-----------------------------------------------
struct COMMAND_RPC_SUBMIT_RAW_TX
{
- struct request
+ struct request_t
{
std::string address;
std::string view_key;
@@ -516,9 +532,10 @@ namespace cryptonote
KV_SERIALIZE(tx)
END_KV_SERIALIZE_MAP()
};
+ typedef epee::misc_utils::struct_init<request_t> request;
- struct response
+ struct response_t
{
std::string status;
std::string error;
@@ -528,11 +545,12 @@ namespace cryptonote
KV_SERIALIZE(error)
END_KV_SERIALIZE_MAP()
};
+ typedef epee::misc_utils::struct_init<response_t> response;
};
//-----------------------------------------------
struct COMMAND_RPC_LOGIN
{
- struct request
+ struct request_t
{
std::string address;
std::string view_key;
@@ -544,9 +562,9 @@ namespace cryptonote
KV_SERIALIZE(create_account)
END_KV_SERIALIZE_MAP()
};
-
-
- struct response
+ typedef epee::misc_utils::struct_init<request_t> request;
+
+ struct response_t
{
std::string status;
std::string reason;
@@ -558,11 +576,12 @@ namespace cryptonote
KV_SERIALIZE(new_address)
END_KV_SERIALIZE_MAP()
};
+ typedef epee::misc_utils::struct_init<response_t> response;
};
//-----------------------------------------------
struct COMMAND_RPC_IMPORT_WALLET_REQUEST
{
- struct request
+ struct request_t
{
std::string address;
std::string view_key;
@@ -572,9 +591,9 @@ namespace cryptonote
KV_SERIALIZE(view_key)
END_KV_SERIALIZE_MAP()
};
-
-
- struct response
+ typedef epee::misc_utils::struct_init<request_t> request;
+
+ struct response_t
{
std::string payment_id;
uint64_t import_fee;
@@ -592,11 +611,12 @@ namespace cryptonote
KV_SERIALIZE(status)
END_KV_SERIALIZE_MAP()
};
+ typedef epee::misc_utils::struct_init<response_t> response;
};
//-----------------------------------------------
struct COMMAND_RPC_GET_TRANSACTIONS
{
- struct request
+ struct request_t
{
std::vector<std::string> txs_hashes;
bool decode_as_json;
@@ -610,6 +630,7 @@ namespace cryptonote
KV_SERIALIZE_OPT(split, false)
END_KV_SERIALIZE_MAP()
};
+ typedef epee::misc_utils::struct_init<request_t> request;
struct entry
{
@@ -640,7 +661,7 @@ namespace cryptonote
END_KV_SERIALIZE_MAP()
};
- struct response
+ struct response_t
{
// older compatibility stuff
std::vector<std::string> txs_as_hex; //transactions blobs as hex (old compat)
@@ -663,6 +684,7 @@ namespace cryptonote
KV_SERIALIZE(untrusted)
END_KV_SERIALIZE_MAP()
};
+ typedef epee::misc_utils::struct_init<response_t> response;
};
//-----------------------------------------------
@@ -674,7 +696,7 @@ namespace cryptonote
SPENT_IN_POOL = 2,
};
- struct request
+ struct request_t
{
std::vector<std::string> key_images;
@@ -682,9 +704,10 @@ namespace cryptonote
KV_SERIALIZE(key_images)
END_KV_SERIALIZE_MAP()
};
+ typedef epee::misc_utils::struct_init<request_t> request;
- struct response
+ struct response_t
{
std::vector<int> spent_status;
std::string status;
@@ -696,21 +719,23 @@ namespace cryptonote
KV_SERIALIZE(untrusted)
END_KV_SERIALIZE_MAP()
};
+ typedef epee::misc_utils::struct_init<response_t> response;
};
//-----------------------------------------------
struct COMMAND_RPC_GET_TX_GLOBAL_OUTPUTS_INDEXES
{
- struct request
+ struct request_t
{
crypto::hash txid;
BEGIN_KV_SERIALIZE_MAP()
KV_SERIALIZE_VAL_POD_AS_BLOB(txid)
END_KV_SERIALIZE_MAP()
};
+ typedef epee::misc_utils::struct_init<request_t> request;
- struct response
+ struct response_t
{
std::vector<uint64_t> o_indexes;
std::string status;
@@ -721,6 +746,7 @@ namespace cryptonote
KV_SERIALIZE(untrusted)
END_KV_SERIALIZE_MAP()
};
+ typedef epee::misc_utils::struct_init<response_t> response;
};
//-----------------------------------------------
struct get_outputs_out
@@ -736,7 +762,7 @@ namespace cryptonote
struct COMMAND_RPC_GET_OUTPUTS_BIN
{
- struct request
+ struct request_t
{
std::vector<get_outputs_out> outputs;
bool get_txid;
@@ -746,6 +772,7 @@ namespace cryptonote
KV_SERIALIZE_OPT(get_txid, true)
END_KV_SERIALIZE_MAP()
};
+ typedef epee::misc_utils::struct_init<request_t> request;
struct outkey
{
@@ -764,7 +791,7 @@ namespace cryptonote
END_KV_SERIALIZE_MAP()
};
- struct response
+ struct response_t
{
std::vector<outkey> outs;
std::string status;
@@ -776,11 +803,12 @@ namespace cryptonote
KV_SERIALIZE(untrusted)
END_KV_SERIALIZE_MAP()
};
+ typedef epee::misc_utils::struct_init<response_t> response;
};
//-----------------------------------------------
struct COMMAND_RPC_GET_OUTPUTS
{
- struct request
+ struct request_t
{
std::vector<get_outputs_out> outputs;
@@ -788,6 +816,7 @@ namespace cryptonote
KV_SERIALIZE(outputs)
END_KV_SERIALIZE_MAP()
};
+ typedef epee::misc_utils::struct_init<request_t> request;
struct outkey
{
@@ -806,7 +835,7 @@ namespace cryptonote
END_KV_SERIALIZE_MAP()
};
- struct response
+ struct response_t
{
std::vector<outkey> outs;
std::string status;
@@ -818,11 +847,12 @@ namespace cryptonote
KV_SERIALIZE(untrusted)
END_KV_SERIALIZE_MAP()
};
+ typedef epee::misc_utils::struct_init<response_t> response;
};
//-----------------------------------------------
struct COMMAND_RPC_SEND_RAW_TX
{
- struct request
+ struct request_t
{
std::string tx_as_hex;
bool do_not_relay;
@@ -832,9 +862,10 @@ namespace cryptonote
KV_SERIALIZE_OPT(do_not_relay, false)
END_KV_SERIALIZE_MAP()
};
+ typedef epee::misc_utils::struct_init<request_t> request;
- struct response
+ struct response_t
{
std::string status;
std::string reason;
@@ -864,11 +895,12 @@ namespace cryptonote
KV_SERIALIZE(untrusted)
END_KV_SERIALIZE_MAP()
};
+ typedef epee::misc_utils::struct_init<response_t> response;
};
//-----------------------------------------------
struct COMMAND_RPC_START_MINING
{
- struct request
+ struct request_t
{
std::string miner_address;
uint64_t threads_count;
@@ -882,8 +914,9 @@ namespace cryptonote
KV_SERIALIZE(ignore_battery)
END_KV_SERIALIZE_MAP()
};
+ typedef epee::misc_utils::struct_init<request_t> request;
- struct response
+ struct response_t
{
std::string status;
@@ -891,18 +924,20 @@ namespace cryptonote
KV_SERIALIZE(status)
END_KV_SERIALIZE_MAP()
};
+ typedef epee::misc_utils::struct_init<response_t> response;
};
//-----------------------------------------------
struct COMMAND_RPC_GET_INFO
{
- struct request
+ struct request_t
{
BEGIN_KV_SERIALIZE_MAP()
END_KV_SERIALIZE_MAP()
};
+ typedef epee::misc_utils::struct_init<request_t> request;
- struct response
+ struct response_t
{
std::string status;
uint64_t height;
@@ -974,21 +1009,23 @@ namespace cryptonote
KV_SERIALIZE(version)
END_KV_SERIALIZE_MAP()
};
+ typedef epee::misc_utils::struct_init<response_t> response;
};
//-----------------------------------------------
struct COMMAND_RPC_STOP_MINING
{
- struct request
+ struct request_t
{
BEGIN_KV_SERIALIZE_MAP()
END_KV_SERIALIZE_MAP()
};
+ typedef epee::misc_utils::struct_init<request_t> request;
- struct response
+ struct response_t
{
std::string status;
@@ -996,20 +1033,22 @@ namespace cryptonote
KV_SERIALIZE(status)
END_KV_SERIALIZE_MAP()
};
+ typedef epee::misc_utils::struct_init<response_t> response;
};
//-----------------------------------------------
struct COMMAND_RPC_MINING_STATUS
{
- struct request
+ struct request_t
{
BEGIN_KV_SERIALIZE_MAP()
END_KV_SERIALIZE_MAP()
};
+ typedef epee::misc_utils::struct_init<request_t> request;
- struct response
+ struct response_t
{
std::string status;
bool active;
@@ -1041,20 +1080,22 @@ namespace cryptonote
KV_SERIALIZE(block_reward)
END_KV_SERIALIZE_MAP()
};
+ typedef epee::misc_utils::struct_init<response_t> response;
};
//-----------------------------------------------
struct COMMAND_RPC_SAVE_BC
{
- struct request
+ struct request_t
{
BEGIN_KV_SERIALIZE_MAP()
END_KV_SERIALIZE_MAP()
};
+ typedef epee::misc_utils::struct_init<request_t> request;
- struct response
+ struct response_t
{
std::string status;
@@ -1062,6 +1103,7 @@ namespace cryptonote
KV_SERIALIZE(status)
END_KV_SERIALIZE_MAP()
};
+ typedef epee::misc_utils::struct_init<response_t> response;
};
//
@@ -1069,7 +1111,7 @@ namespace cryptonote
{
typedef std::list<std::string> request;
- struct response
+ struct response_t
{
uint64_t count;
std::string status;
@@ -1079,7 +1121,7 @@ namespace cryptonote
KV_SERIALIZE(status)
END_KV_SERIALIZE_MAP()
};
-
+ typedef epee::misc_utils::struct_init<response_t> response;
};
struct COMMAND_RPC_GETBLOCKHASH
@@ -1092,7 +1134,7 @@ namespace cryptonote
struct COMMAND_RPC_GETBLOCKTEMPLATE
{
- struct request
+ struct request_t
{
uint64_t reserve_size; //max 255 bytes
std::string wallet_address;
@@ -1102,8 +1144,9 @@ namespace cryptonote
KV_SERIALIZE(wallet_address)
END_KV_SERIALIZE_MAP()
};
+ typedef epee::misc_utils::struct_init<request_t> request;
- struct response
+ struct response_t
{
uint64_t difficulty;
uint64_t height;
@@ -1127,13 +1170,14 @@ namespace cryptonote
KV_SERIALIZE(untrusted)
END_KV_SERIALIZE_MAP()
};
+ typedef epee::misc_utils::struct_init<response_t> response;
};
struct COMMAND_RPC_SUBMITBLOCK
{
typedef std::vector<std::string> request;
- struct response
+ struct response_t
{
std::string status;
@@ -1141,11 +1185,12 @@ namespace cryptonote
KV_SERIALIZE(status)
END_KV_SERIALIZE_MAP()
};
+ typedef epee::misc_utils::struct_init<response_t> response;
};
struct COMMAND_RPC_GENERATEBLOCKS
{
- struct request
+ struct request_t
{
uint64_t amount_of_blocks;
std::string wallet_address;
@@ -1155,8 +1200,9 @@ namespace cryptonote
KV_SERIALIZE(wallet_address)
END_KV_SERIALIZE_MAP()
};
+ typedef epee::misc_utils::struct_init<request_t> request;
- struct response
+ struct response_t
{
uint64_t height;
std::string status;
@@ -1166,6 +1212,7 @@ namespace cryptonote
KV_SERIALIZE(status)
END_KV_SERIALIZE_MAP()
};
+ typedef epee::misc_utils::struct_init<response_t> response;
};
struct block_header_response
@@ -1186,6 +1233,7 @@ namespace cryptonote
uint64_t block_weight;
uint64_t num_txes;
std::string pow_hash;
+ uint64_t long_term_weight;
BEGIN_KV_SERIALIZE_MAP()
KV_SERIALIZE(major_version)
@@ -1204,12 +1252,13 @@ namespace cryptonote
KV_SERIALIZE_OPT(block_weight, (uint64_t)0)
KV_SERIALIZE(num_txes)
KV_SERIALIZE(pow_hash)
+ KV_SERIALIZE_OPT(long_term_weight, (uint64_t)0)
END_KV_SERIALIZE_MAP()
};
struct COMMAND_RPC_GET_LAST_BLOCK_HEADER
{
- struct request
+ struct request_t
{
bool fill_pow_hash;
@@ -1217,8 +1266,9 @@ namespace cryptonote
KV_SERIALIZE_OPT(fill_pow_hash, false);
END_KV_SERIALIZE_MAP()
};
+ typedef epee::misc_utils::struct_init<request_t> request;
- struct response
+ struct response_t
{
std::string status;
block_header_response block_header;
@@ -1230,12 +1280,13 @@ namespace cryptonote
KV_SERIALIZE(untrusted)
END_KV_SERIALIZE_MAP()
};
+ typedef epee::misc_utils::struct_init<response_t> response;
};
struct COMMAND_RPC_GET_BLOCK_HEADER_BY_HASH
{
- struct request
+ struct request_t
{
std::string hash;
bool fill_pow_hash;
@@ -1245,8 +1296,9 @@ namespace cryptonote
KV_SERIALIZE_OPT(fill_pow_hash, false);
END_KV_SERIALIZE_MAP()
};
+ typedef epee::misc_utils::struct_init<request_t> request;
- struct response
+ struct response_t
{
std::string status;
block_header_response block_header;
@@ -1258,12 +1310,12 @@ namespace cryptonote
KV_SERIALIZE(untrusted)
END_KV_SERIALIZE_MAP()
};
-
+ typedef epee::misc_utils::struct_init<response_t> response;
};
struct COMMAND_RPC_GET_BLOCK_HEADER_BY_HEIGHT
{
- struct request
+ struct request_t
{
uint64_t height;
bool fill_pow_hash;
@@ -1273,8 +1325,9 @@ namespace cryptonote
KV_SERIALIZE_OPT(fill_pow_hash, false);
END_KV_SERIALIZE_MAP()
};
+ typedef epee::misc_utils::struct_init<request_t> request;
- struct response
+ struct response_t
{
std::string status;
block_header_response block_header;
@@ -1286,12 +1339,12 @@ namespace cryptonote
KV_SERIALIZE(untrusted)
END_KV_SERIALIZE_MAP()
};
-
+ typedef epee::misc_utils::struct_init<response_t> response;
};
struct COMMAND_RPC_GET_BLOCK
{
- struct request
+ struct request_t
{
std::string hash;
uint64_t height;
@@ -1303,8 +1356,9 @@ namespace cryptonote
KV_SERIALIZE_OPT(fill_pow_hash, false);
END_KV_SERIALIZE_MAP()
};
+ typedef epee::misc_utils::struct_init<request_t> request;
- struct response
+ struct response_t
{
std::string status;
block_header_response block_header;
@@ -1324,7 +1378,7 @@ namespace cryptonote
KV_SERIALIZE(untrusted)
END_KV_SERIALIZE_MAP()
};
-
+ typedef epee::misc_utils::struct_init<response_t> response;
};
struct peer {
@@ -1356,13 +1410,14 @@ namespace cryptonote
struct COMMAND_RPC_GET_PEER_LIST
{
- struct request
+ struct request_t
{
BEGIN_KV_SERIALIZE_MAP()
END_KV_SERIALIZE_MAP()
};
+ typedef epee::misc_utils::struct_init<request_t> request;
- struct response
+ struct response_t
{
std::string status;
std::vector<peer> white_list;
@@ -1374,11 +1429,12 @@ namespace cryptonote
KV_SERIALIZE(gray_list)
END_KV_SERIALIZE_MAP()
};
+ typedef epee::misc_utils::struct_init<response_t> response;
};
struct COMMAND_RPC_SET_LOG_HASH_RATE
{
- struct request
+ struct request_t
{
bool visible;
@@ -1386,19 +1442,21 @@ namespace cryptonote
KV_SERIALIZE(visible)
END_KV_SERIALIZE_MAP()
};
+ typedef epee::misc_utils::struct_init<request_t> request;
- struct response
+ struct response_t
{
std::string status;
BEGIN_KV_SERIALIZE_MAP()
KV_SERIALIZE(status)
END_KV_SERIALIZE_MAP()
};
+ typedef epee::misc_utils::struct_init<response_t> response;
};
struct COMMAND_RPC_SET_LOG_LEVEL
{
- struct request
+ struct request_t
{
int8_t level;
@@ -1406,19 +1464,21 @@ namespace cryptonote
KV_SERIALIZE(level)
END_KV_SERIALIZE_MAP()
};
+ typedef epee::misc_utils::struct_init<request_t> request;
- struct response
+ struct response_t
{
std::string status;
BEGIN_KV_SERIALIZE_MAP()
KV_SERIALIZE(status)
END_KV_SERIALIZE_MAP()
};
+ typedef epee::misc_utils::struct_init<response_t> response;
};
struct COMMAND_RPC_SET_LOG_CATEGORIES
{
- struct request
+ struct request_t
{
std::string categories;
@@ -1426,8 +1486,9 @@ namespace cryptonote
KV_SERIALIZE(categories)
END_KV_SERIALIZE_MAP()
};
+ typedef epee::misc_utils::struct_init<request_t> request;
- struct response
+ struct response_t
{
std::string status;
std::string categories;
@@ -1437,6 +1498,7 @@ namespace cryptonote
KV_SERIALIZE(categories)
END_KV_SERIALIZE_MAP()
};
+ typedef epee::misc_utils::struct_init<response_t> response;
};
struct tx_info
@@ -1491,13 +1553,14 @@ namespace cryptonote
struct COMMAND_RPC_GET_TRANSACTION_POOL
{
- struct request
+ struct request_t
{
BEGIN_KV_SERIALIZE_MAP()
END_KV_SERIALIZE_MAP()
};
+ typedef epee::misc_utils::struct_init<request_t> request;
- struct response
+ struct response_t
{
std::string status;
std::vector<tx_info> transactions;
@@ -1511,17 +1574,19 @@ namespace cryptonote
KV_SERIALIZE(untrusted)
END_KV_SERIALIZE_MAP()
};
+ typedef epee::misc_utils::struct_init<response_t> response;
};
struct COMMAND_RPC_GET_TRANSACTION_POOL_HASHES_BIN
{
- struct request
+ struct request_t
{
BEGIN_KV_SERIALIZE_MAP()
END_KV_SERIALIZE_MAP()
};
+ typedef epee::misc_utils::struct_init<request_t> request;
- struct response
+ struct response_t
{
std::string status;
std::vector<crypto::hash> tx_hashes;
@@ -1533,17 +1598,19 @@ namespace cryptonote
KV_SERIALIZE(untrusted)
END_KV_SERIALIZE_MAP()
};
+ typedef epee::misc_utils::struct_init<response_t> response;
};
struct COMMAND_RPC_GET_TRANSACTION_POOL_HASHES
{
- struct request
+ struct request_t
{
BEGIN_KV_SERIALIZE_MAP()
END_KV_SERIALIZE_MAP()
};
+ typedef epee::misc_utils::struct_init<request_t> request;
- struct response
+ struct response_t
{
std::string status;
std::vector<std::string> tx_hashes;
@@ -1555,6 +1622,7 @@ namespace cryptonote
KV_SERIALIZE(untrusted)
END_KV_SERIALIZE_MAP()
};
+ typedef epee::misc_utils::struct_init<response_t> response;
};
struct tx_backlog_entry
@@ -1566,13 +1634,14 @@ namespace cryptonote
struct COMMAND_RPC_GET_TRANSACTION_POOL_BACKLOG
{
- struct request
+ struct request_t
{
BEGIN_KV_SERIALIZE_MAP()
END_KV_SERIALIZE_MAP()
};
+ typedef epee::misc_utils::struct_init<request_t> request;
- struct response
+ struct response_t
{
std::string status;
std::vector<tx_backlog_entry> backlog;
@@ -1584,6 +1653,7 @@ namespace cryptonote
KV_SERIALIZE(untrusted)
END_KV_SERIALIZE_MAP()
};
+ typedef epee::misc_utils::struct_init<response_t> response;
};
struct txpool_histo
@@ -1634,13 +1704,14 @@ namespace cryptonote
struct COMMAND_RPC_GET_TRANSACTION_POOL_STATS
{
- struct request
+ struct request_t
{
BEGIN_KV_SERIALIZE_MAP()
END_KV_SERIALIZE_MAP()
};
+ typedef epee::misc_utils::struct_init<request_t> request;
- struct response
+ struct response_t
{
std::string status;
txpool_stats pool_stats;
@@ -1652,17 +1723,19 @@ namespace cryptonote
KV_SERIALIZE(untrusted)
END_KV_SERIALIZE_MAP()
};
+ typedef epee::misc_utils::struct_init<response_t> response;
};
struct COMMAND_RPC_GET_CONNECTIONS
{
- struct request
+ struct request_t
{
BEGIN_KV_SERIALIZE_MAP()
END_KV_SERIALIZE_MAP()
};
+ typedef epee::misc_utils::struct_init<request_t> request;
- struct response
+ struct response_t
{
std::string status;
std::list<connection_info> connections;
@@ -1672,12 +1745,12 @@ namespace cryptonote
KV_SERIALIZE(connections)
END_KV_SERIALIZE_MAP()
};
-
+ typedef epee::misc_utils::struct_init<response_t> response;
};
struct COMMAND_RPC_GET_BLOCK_HEADERS_RANGE
{
- struct request
+ struct request_t
{
uint64_t start_height;
uint64_t end_height;
@@ -1689,8 +1762,9 @@ namespace cryptonote
KV_SERIALIZE_OPT(fill_pow_hash, false);
END_KV_SERIALIZE_MAP()
};
+ typedef epee::misc_utils::struct_init<request_t> request;
- struct response
+ struct response_t
{
std::string status;
std::vector<block_header_response> headers;
@@ -1702,17 +1776,19 @@ namespace cryptonote
KV_SERIALIZE(untrusted)
END_KV_SERIALIZE_MAP()
};
+ typedef epee::misc_utils::struct_init<response_t> response;
};
struct COMMAND_RPC_STOP_DAEMON
{
- struct request
+ struct request_t
{
BEGIN_KV_SERIALIZE_MAP()
END_KV_SERIALIZE_MAP()
};
+ typedef epee::misc_utils::struct_init<request_t> request;
- struct response
+ struct response_t
{
std::string status;
@@ -1720,17 +1796,19 @@ namespace cryptonote
KV_SERIALIZE(status)
END_KV_SERIALIZE_MAP()
};
+ typedef epee::misc_utils::struct_init<response_t> response;
};
struct COMMAND_RPC_FAST_EXIT
{
- struct request
+ struct request_t
{
BEGIN_KV_SERIALIZE_MAP()
END_KV_SERIALIZE_MAP()
};
+ typedef epee::misc_utils::struct_init<request_t> request;
- struct response
+ struct response_t
{
std::string status;
@@ -1738,17 +1816,19 @@ namespace cryptonote
KV_SERIALIZE(status)
END_KV_SERIALIZE_MAP()
};
+ typedef epee::misc_utils::struct_init<response_t> response;
};
struct COMMAND_RPC_GET_LIMIT
{
- struct request
+ struct request_t
{
BEGIN_KV_SERIALIZE_MAP()
END_KV_SERIALIZE_MAP()
};
+ typedef epee::misc_utils::struct_init<request_t> request;
- struct response
+ struct response_t
{
std::string status;
uint64_t limit_up;
@@ -1762,11 +1842,12 @@ namespace cryptonote
KV_SERIALIZE(untrusted)
END_KV_SERIALIZE_MAP()
};
+ typedef epee::misc_utils::struct_init<response_t> response;
};
struct COMMAND_RPC_SET_LIMIT
{
- struct request
+ struct request_t
{
int64_t limit_down; // all limits (for get and set) are kB/s
int64_t limit_up;
@@ -1776,8 +1857,9 @@ namespace cryptonote
KV_SERIALIZE(limit_up)
END_KV_SERIALIZE_MAP()
};
+ typedef epee::misc_utils::struct_init<request_t> request;
- struct response
+ struct response_t
{
std::string status;
int64_t limit_up;
@@ -1789,19 +1871,21 @@ namespace cryptonote
KV_SERIALIZE(limit_down)
END_KV_SERIALIZE_MAP()
};
+ typedef epee::misc_utils::struct_init<response_t> response;
};
struct COMMAND_RPC_OUT_PEERS
{
- struct request
+ struct request_t
{
uint64_t out_peers;
BEGIN_KV_SERIALIZE_MAP()
KV_SERIALIZE(out_peers)
END_KV_SERIALIZE_MAP()
};
+ typedef epee::misc_utils::struct_init<request_t> request;
- struct response
+ struct response_t
{
std::string status;
@@ -1809,19 +1893,21 @@ namespace cryptonote
KV_SERIALIZE(status)
END_KV_SERIALIZE_MAP()
};
+ typedef epee::misc_utils::struct_init<response_t> response;
};
struct COMMAND_RPC_IN_PEERS
{
- struct request
+ struct request_t
{
uint64_t in_peers;
BEGIN_KV_SERIALIZE_MAP()
KV_SERIALIZE(in_peers)
END_KV_SERIALIZE_MAP()
};
+ typedef epee::misc_utils::struct_init<request_t> request;
- struct response
+ struct response_t
{
std::string status;
@@ -1829,17 +1915,19 @@ namespace cryptonote
KV_SERIALIZE(status)
END_KV_SERIALIZE_MAP()
};
+ typedef epee::misc_utils::struct_init<response_t> response;
};
struct COMMAND_RPC_START_SAVE_GRAPH
{
- struct request
+ struct request_t
{
BEGIN_KV_SERIALIZE_MAP()
END_KV_SERIALIZE_MAP()
};
+ typedef epee::misc_utils::struct_init<request_t> request;
- struct response
+ struct response_t
{
std::string status;
@@ -1847,17 +1935,19 @@ namespace cryptonote
KV_SERIALIZE(status)
END_KV_SERIALIZE_MAP()
};
+ typedef epee::misc_utils::struct_init<response_t> response;
};
struct COMMAND_RPC_STOP_SAVE_GRAPH
{
- struct request
+ struct request_t
{
BEGIN_KV_SERIALIZE_MAP()
END_KV_SERIALIZE_MAP()
};
+ typedef epee::misc_utils::struct_init<request_t> request;
- struct response
+ struct response_t
{
std::string status;
@@ -1865,11 +1955,12 @@ namespace cryptonote
KV_SERIALIZE(status)
END_KV_SERIALIZE_MAP()
};
+ typedef epee::misc_utils::struct_init<response_t> response;
};
struct COMMAND_RPC_HARD_FORK_INFO
{
- struct request
+ struct request_t
{
uint8_t version;
@@ -1877,8 +1968,9 @@ namespace cryptonote
KV_SERIALIZE(version)
END_KV_SERIALIZE_MAP()
};
+ typedef epee::misc_utils::struct_init<request_t> request;
- struct response
+ struct response_t
{
uint8_t version;
bool enabled;
@@ -1904,6 +1996,7 @@ namespace cryptonote
KV_SERIALIZE(untrusted)
END_KV_SERIALIZE_MAP()
};
+ typedef epee::misc_utils::struct_init<response_t> response;
};
struct COMMAND_RPC_GETBANS
@@ -1921,13 +2014,14 @@ namespace cryptonote
END_KV_SERIALIZE_MAP()
};
- struct request
+ struct request_t
{
BEGIN_KV_SERIALIZE_MAP()
END_KV_SERIALIZE_MAP()
};
+ typedef epee::misc_utils::struct_init<request_t> request;
- struct response
+ struct response_t
{
std::string status;
std::vector<ban> bans;
@@ -1937,6 +2031,7 @@ namespace cryptonote
KV_SERIALIZE(bans)
END_KV_SERIALIZE_MAP()
};
+ typedef epee::misc_utils::struct_init<response_t> response;
};
struct COMMAND_RPC_SETBANS
@@ -1956,7 +2051,7 @@ namespace cryptonote
END_KV_SERIALIZE_MAP()
};
- struct request
+ struct request_t
{
std::vector<ban> bans;
@@ -1964,8 +2059,9 @@ namespace cryptonote
KV_SERIALIZE(bans)
END_KV_SERIALIZE_MAP()
};
+ typedef epee::misc_utils::struct_init<request_t> request;
- struct response
+ struct response_t
{
std::string status;
@@ -1973,11 +2069,12 @@ namespace cryptonote
KV_SERIALIZE(status)
END_KV_SERIALIZE_MAP()
};
+ typedef epee::misc_utils::struct_init<response_t> response;
};
struct COMMAND_RPC_FLUSH_TRANSACTION_POOL
{
- struct request
+ struct request_t
{
std::vector<std::string> txids;
@@ -1985,8 +2082,9 @@ namespace cryptonote
KV_SERIALIZE(txids)
END_KV_SERIALIZE_MAP()
};
+ typedef epee::misc_utils::struct_init<request_t> request;
- struct response
+ struct response_t
{
std::string status;
@@ -1994,11 +2092,12 @@ namespace cryptonote
KV_SERIALIZE(status)
END_KV_SERIALIZE_MAP()
};
+ typedef epee::misc_utils::struct_init<response_t> response;
};
struct COMMAND_RPC_GET_OUTPUT_HISTOGRAM
{
- struct request
+ struct request_t
{
std::vector<uint64_t> amounts;
uint64_t min_count;
@@ -2014,6 +2113,7 @@ namespace cryptonote
KV_SERIALIZE(recent_cutoff);
END_KV_SERIALIZE_MAP()
};
+ typedef epee::misc_utils::struct_init<request_t> request;
struct entry
{
@@ -2034,7 +2134,7 @@ namespace cryptonote
entry() {}
};
- struct response
+ struct response_t
{
std::string status;
std::vector<entry> histogram;
@@ -2046,17 +2146,19 @@ namespace cryptonote
KV_SERIALIZE(untrusted)
END_KV_SERIALIZE_MAP()
};
+ typedef epee::misc_utils::struct_init<response_t> response;
};
struct COMMAND_RPC_GET_VERSION
{
- struct request
+ struct request_t
{
BEGIN_KV_SERIALIZE_MAP()
END_KV_SERIALIZE_MAP()
};
+ typedef epee::misc_utils::struct_init<request_t> request;
- struct response
+ struct response_t
{
std::string status;
uint32_t version;
@@ -2068,11 +2170,12 @@ namespace cryptonote
KV_SERIALIZE(untrusted)
END_KV_SERIALIZE_MAP()
};
+ typedef epee::misc_utils::struct_init<response_t> response;
};
struct COMMAND_RPC_GET_COINBASE_TX_SUM
{
- struct request
+ struct request_t
{
uint64_t height;
uint64_t count;
@@ -2082,8 +2185,9 @@ namespace cryptonote
KV_SERIALIZE(count);
END_KV_SERIALIZE_MAP()
};
+ typedef epee::misc_utils::struct_init<request_t> request;
- struct response
+ struct response_t
{
std::string status;
uint64_t emission_amount;
@@ -2095,11 +2199,12 @@ namespace cryptonote
KV_SERIALIZE(fee_amount)
END_KV_SERIALIZE_MAP()
};
+ typedef epee::misc_utils::struct_init<response_t> response;
};
struct COMMAND_RPC_GET_BASE_FEE_ESTIMATE
{
- struct request
+ struct request_t
{
uint64_t grace_blocks;
@@ -2107,8 +2212,9 @@ namespace cryptonote
KV_SERIALIZE(grace_blocks)
END_KV_SERIALIZE_MAP()
};
+ typedef epee::misc_utils::struct_init<request_t> request;
- struct response
+ struct response_t
{
std::string status;
uint64_t fee;
@@ -2122,15 +2228,17 @@ namespace cryptonote
KV_SERIALIZE(untrusted)
END_KV_SERIALIZE_MAP()
};
+ typedef epee::misc_utils::struct_init<response_t> response;
};
struct COMMAND_RPC_GET_ALTERNATE_CHAINS
{
- struct request
+ struct request_t
{
BEGIN_KV_SERIALIZE_MAP()
END_KV_SERIALIZE_MAP()
};
+ typedef epee::misc_utils::struct_init<request_t> request;
struct chain_info
{
@@ -2151,7 +2259,7 @@ namespace cryptonote
END_KV_SERIALIZE_MAP()
};
- struct response
+ struct response_t
{
std::string status;
std::list<chain_info> chains;
@@ -2161,11 +2269,12 @@ namespace cryptonote
KV_SERIALIZE(chains)
END_KV_SERIALIZE_MAP()
};
+ typedef epee::misc_utils::struct_init<response_t> response;
};
struct COMMAND_RPC_UPDATE
{
- struct request
+ struct request_t
{
std::string command;
std::string path;
@@ -2175,8 +2284,9 @@ namespace cryptonote
KV_SERIALIZE(path);
END_KV_SERIALIZE_MAP()
};
+ typedef epee::misc_utils::struct_init<request_t> request;
- struct response
+ struct response_t
{
std::string status;
bool update;
@@ -2196,11 +2306,12 @@ namespace cryptonote
KV_SERIALIZE(path)
END_KV_SERIALIZE_MAP()
};
+ typedef epee::misc_utils::struct_init<response_t> response;
};
struct COMMAND_RPC_RELAY_TX
{
- struct request
+ struct request_t
{
std::vector<std::string> txids;
@@ -2208,8 +2319,9 @@ namespace cryptonote
KV_SERIALIZE(txids)
END_KV_SERIALIZE_MAP()
};
+ typedef epee::misc_utils::struct_init<request_t> request;
- struct response
+ struct response_t
{
std::string status;
@@ -2217,15 +2329,17 @@ namespace cryptonote
KV_SERIALIZE(status)
END_KV_SERIALIZE_MAP()
};
+ typedef epee::misc_utils::struct_init<response_t> response;
};
struct COMMAND_RPC_SYNC_INFO
{
- struct request
+ struct request_t
{
BEGIN_KV_SERIALIZE_MAP()
END_KV_SERIALIZE_MAP()
};
+ typedef epee::misc_utils::struct_init<request_t> request;
struct peer
{
@@ -2257,7 +2371,7 @@ namespace cryptonote
END_KV_SERIALIZE_MAP()
};
- struct response
+ struct response_t
{
std::string status;
uint64_t height;
@@ -2277,11 +2391,12 @@ namespace cryptonote
KV_SERIALIZE(overview)
END_KV_SERIALIZE_MAP()
};
+ typedef epee::misc_utils::struct_init<response_t> response;
};
struct COMMAND_RPC_GET_OUTPUT_DISTRIBUTION
{
- struct request
+ struct request_t
{
std::vector<uint64_t> amounts;
uint64_t from_height;
@@ -2299,6 +2414,7 @@ namespace cryptonote
KV_SERIALIZE_OPT(compress, false)
END_KV_SERIALIZE_MAP()
};
+ typedef epee::misc_utils::struct_init<request_t> request;
struct distribution
{
@@ -2342,7 +2458,7 @@ namespace cryptonote
END_KV_SERIALIZE_MAP()
};
- struct response
+ struct response_t
{
std::string status;
std::vector<distribution> distributions;
@@ -2354,11 +2470,12 @@ namespace cryptonote
KV_SERIALIZE(untrusted)
END_KV_SERIALIZE_MAP()
};
+ typedef epee::misc_utils::struct_init<response_t> response;
};
struct COMMAND_RPC_POP_BLOCKS
{
- struct request
+ struct request_t
{
uint64_t nblocks;
@@ -2366,8 +2483,9 @@ namespace cryptonote
KV_SERIALIZE(nblocks);
END_KV_SERIALIZE_MAP()
};
+ typedef epee::misc_utils::struct_init<request_t> request;
- struct response
+ struct response_t
{
std::string status;
uint64_t height;
@@ -2377,11 +2495,12 @@ namespace cryptonote
KV_SERIALIZE(height)
END_KV_SERIALIZE_MAP()
};
+ typedef epee::misc_utils::struct_init<response_t> response;
};
struct COMMAND_RPC_PRUNE_BLOCKCHAIN
{
- struct request
+ struct request_t
{
bool check;
@@ -2389,8 +2508,9 @@ namespace cryptonote
KV_SERIALIZE_OPT(check, false)
END_KV_SERIALIZE_MAP()
};
+ typedef epee::misc_utils::struct_init<request_t> request;
- struct response
+ struct response_t
{
uint32_t pruning_seed;
std::string status;
@@ -2400,6 +2520,7 @@ namespace cryptonote
KV_SERIALIZE(pruning_seed)
END_KV_SERIALIZE_MAP()
};
+ typedef epee::misc_utils::struct_init<response_t> response;
};
}
diff --git a/src/rpc/core_rpc_server_error_codes.h b/src/rpc/core_rpc_server_error_codes.h
index 5a754749f..b13049e61 100644
--- a/src/rpc/core_rpc_server_error_codes.h
+++ b/src/rpc/core_rpc_server_error_codes.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2014-2018, The Monero Project
+// Copyright (c) 2014-2019, The Monero Project
//
// All rights reserved.
//
diff --git a/src/rpc/daemon_handler.cpp b/src/rpc/daemon_handler.cpp
index 871f7d368..14b492786 100644
--- a/src/rpc/daemon_handler.cpp
+++ b/src/rpc/daemon_handler.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2017-2018, The Monero Project
+// Copyright (c) 2017-2019, The Monero Project
//
// All rights reserved.
//
diff --git a/src/rpc/daemon_handler.h b/src/rpc/daemon_handler.h
index 2c8ac3867..87161784e 100644
--- a/src/rpc/daemon_handler.h
+++ b/src/rpc/daemon_handler.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2017-2018, The Monero Project
+// Copyright (c) 2017-2019, The Monero Project
//
// All rights reserved.
//
diff --git a/src/rpc/daemon_messages.cpp b/src/rpc/daemon_messages.cpp
index 7c7442014..ecd3683e5 100644
--- a/src/rpc/daemon_messages.cpp
+++ b/src/rpc/daemon_messages.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2016-2018, The Monero Project
+// Copyright (c) 2016-2019, The Monero Project
//
// All rights reserved.
//
diff --git a/src/rpc/daemon_messages.h b/src/rpc/daemon_messages.h
index d2014247c..8ce56b6af 100644
--- a/src/rpc/daemon_messages.h
+++ b/src/rpc/daemon_messages.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2016-2018, The Monero Project
+// Copyright (c) 2016-2019, The Monero Project
//
// All rights reserved.
//
diff --git a/src/rpc/daemon_rpc_version.h b/src/rpc/daemon_rpc_version.h
index e20af5b21..b3eb9699b 100644
--- a/src/rpc/daemon_rpc_version.h
+++ b/src/rpc/daemon_rpc_version.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2016-2018, The Monero Project
+// Copyright (c) 2016-2019, The Monero Project
//
// All rights reserved.
//
diff --git a/src/rpc/instanciations.cpp b/src/rpc/instanciations.cpp
index ec8882982..94fdb5f18 100644
--- a/src/rpc/instanciations.cpp
+++ b/src/rpc/instanciations.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2017-2018, The Monero Project
+// Copyright (c) 2017-2019, The Monero Project
//
// All rights reserved.
//
diff --git a/src/rpc/message.cpp b/src/rpc/message.cpp
index 0ebe34efe..158b58005 100644
--- a/src/rpc/message.cpp
+++ b/src/rpc/message.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2016-2018, The Monero Project
+// Copyright (c) 2016-2019, The Monero Project
//
// All rights reserved.
//
diff --git a/src/rpc/message.h b/src/rpc/message.h
index 56087b998..2b7b61ab3 100644
--- a/src/rpc/message.h
+++ b/src/rpc/message.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2016-2018, The Monero Project
+// Copyright (c) 2016-2019, The Monero Project
//
// All rights reserved.
//
diff --git a/src/rpc/message_data_structs.h b/src/rpc/message_data_structs.h
index 73cf28cec..8b5e02417 100644
--- a/src/rpc/message_data_structs.h
+++ b/src/rpc/message_data_structs.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2016-2018, The Monero Project
+// Copyright (c) 2016-2019, The Monero Project
//
// All rights reserved.
//
diff --git a/src/rpc/rpc_args.cpp b/src/rpc/rpc_args.cpp
index 60c78480a..f2be94f51 100644
--- a/src/rpc/rpc_args.cpp
+++ b/src/rpc/rpc_args.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2014-2018, The Monero Project
+// Copyright (c) 2014-2019, The Monero Project
//
// All rights reserved.
//
diff --git a/src/rpc/rpc_args.h b/src/rpc/rpc_args.h
index 8e375385b..216ba3712 100644
--- a/src/rpc/rpc_args.h
+++ b/src/rpc/rpc_args.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2014-2018, The Monero Project
+// Copyright (c) 2014-2019, The Monero Project
//
// All rights reserved.
//
diff --git a/src/rpc/rpc_handler.h b/src/rpc/rpc_handler.h
index e0d520408..2439eaa58 100644
--- a/src/rpc/rpc_handler.h
+++ b/src/rpc/rpc_handler.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2016-2018, The Monero Project
+// Copyright (c) 2016-2019, The Monero Project
//
// All rights reserved.
//
diff --git a/src/rpc/zmq_server.cpp b/src/rpc/zmq_server.cpp
index a2ff76668..ae748e052 100644
--- a/src/rpc/zmq_server.cpp
+++ b/src/rpc/zmq_server.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2016-2018, The Monero Project
+// Copyright (c) 2016-2019, The Monero Project
//
// All rights reserved.
//
diff --git a/src/rpc/zmq_server.h b/src/rpc/zmq_server.h
index 0cd906a3f..1b1e4c7cf 100644
--- a/src/rpc/zmq_server.h
+++ b/src/rpc/zmq_server.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2016-2018, The Monero Project
+// Copyright (c) 2016-2019, The Monero Project
//
// All rights reserved.
//