aboutsummaryrefslogtreecommitdiff
path: root/src/rpc
diff options
context:
space:
mode:
authorjeffro256 <jeffro256@tutanota.com>2023-06-02 22:00:11 -0500
committerjeffro256 <jeffro256@tutanota.com>2023-06-30 15:31:35 -0500
commite8cac61f4b9a662cbc1b00e46d1f9a3dd991c5f0 (patch)
treedfa9d9d3fec664f4e64693d8b19bdf75c50236c7 /src/rpc
parentMerge pull request #8884 (diff)
downloadmonero-e8cac61f4b9a662cbc1b00e46d1f9a3dd991c5f0.tar.xz
core_rpc_server: return ID of submitted block
Diffstat (limited to 'src/rpc')
-rw-r--r--src/rpc/core_rpc_server.cpp4
-rw-r--r--src/rpc/core_rpc_server_commands_defs.h5
2 files changed, 7 insertions, 2 deletions
diff --git a/src/rpc/core_rpc_server.cpp b/src/rpc/core_rpc_server.cpp
index cb347110d..391564dab 100644
--- a/src/rpc/core_rpc_server.cpp
+++ b/src/rpc/core_rpc_server.cpp
@@ -2189,7 +2189,8 @@ namespace cryptonote
// Fixing of high orphan issue for most pools
// Thanks Boolberry!
block b;
- if(!parse_and_validate_block_from_blob(blockblob, b))
+ crypto::hash blk_id;
+ if(!parse_and_validate_block_from_blob(blockblob, b, blk_id))
{
error_resp.code = CORE_RPC_ERROR_CODE_WRONG_BLOCKBLOB;
error_resp.message = "Wrong block blob";
@@ -2212,6 +2213,7 @@ namespace cryptonote
error_resp.message = "Block not accepted";
return false;
}
+ res.block_id = epee::string_tools::pod_to_hex(blk_id);
res.status = CORE_RPC_STATUS_OK;
return true;
}
diff --git a/src/rpc/core_rpc_server_commands_defs.h b/src/rpc/core_rpc_server_commands_defs.h
index 7f1581d0c..819d77c1f 100644
--- a/src/rpc/core_rpc_server_commands_defs.h
+++ b/src/rpc/core_rpc_server_commands_defs.h
@@ -88,7 +88,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 3
-#define CORE_RPC_VERSION_MINOR 12
+#define CORE_RPC_VERSION_MINOR 13
#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)
@@ -1115,8 +1115,11 @@ namespace cryptonote
struct response_t: public rpc_response_base
{
+ std::string block_id;
+
BEGIN_KV_SERIALIZE_MAP()
KV_SERIALIZE_PARENT(rpc_response_base)
+ KV_SERIALIZE(block_id)
END_KV_SERIALIZE_MAP()
};
typedef epee::misc_utils::struct_init<response_t> response;