aboutsummaryrefslogtreecommitdiff
path: root/src/rpc/daemon_messages.cpp
diff options
context:
space:
mode:
authorNathan Dorfman <ndorf@rtfm.net>2019-02-15 23:28:15 -0700
committerNathan Dorfman <ndorf@rtfm.net>2019-02-27 16:55:04 -0700
commitbe6f426a3fe26d1df447d010e49e142645afa7a2 (patch)
tree37dc4257d8504826160412231c031870581e8827 /src/rpc/daemon_messages.cpp
parentMerge pull request #4988 (diff)
downloadmonero-be6f426a3fe26d1df447d010e49e142645afa7a2.tar.xz
rpc: Allow submitting tx as hex blob over ZMQ
Diffstat (limited to 'src/rpc/daemon_messages.cpp')
-rw-r--r--src/rpc/daemon_messages.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/rpc/daemon_messages.cpp b/src/rpc/daemon_messages.cpp
index 7c7442014..d4e518180 100644
--- a/src/rpc/daemon_messages.cpp
+++ b/src/rpc/daemon_messages.cpp
@@ -42,6 +42,7 @@ const char* const GetTransactions::name = "get_transactions";
const char* const KeyImagesSpent::name = "key_images_spent";
const char* const GetTxGlobalOutputIndices::name = "get_tx_global_output_indices";
const char* const SendRawTx::name = "send_raw_tx";
+const char* const SendRawTxHex::name = "send_raw_tx_hex";
const char* const StartMining::name = "start_mining";
const char* const StopMining::name = "stop_mining";
const char* const MiningStatus::name = "mining_status";
@@ -292,6 +293,22 @@ void SendRawTx::Response::fromJson(rapidjson::Value& val)
GET_FROM_JSON_OBJECT(val, relayed, relayed);
}
+rapidjson::Value SendRawTxHex::Request::toJson(rapidjson::Document& doc) const
+{
+ auto val = Message::toJson(doc);
+
+ INSERT_INTO_JSON_OBJECT(val, doc, tx_as_hex, tx_as_hex);
+ INSERT_INTO_JSON_OBJECT(val, doc, relay, relay);
+
+ return val;
+}
+
+void SendRawTxHex::Request::fromJson(rapidjson::Value& val)
+{
+ GET_FROM_JSON_OBJECT(val, tx_as_hex, tx_as_hex);
+ GET_FROM_JSON_OBJECT(val, relay, relay);
+}
+
rapidjson::Value StartMining::Request::toJson(rapidjson::Document& doc) const
{
auto val = Message::toJson(doc);