From 62a63ea382b50c6c26dbda2dee60fd515c1c696a Mon Sep 17 00:00:00 2001 From: Zachary Michaels Date: Thu, 26 Jun 2014 14:23:47 -0400 Subject: [PATCH] Move block_header_responce into its own file --- src/rpc/block_header_responce.h | 38 +++++++++++++++++++++++++ src/rpc/core_rpc_server_commands_defs.h | 34 +--------------------- 2 files changed, 39 insertions(+), 33 deletions(-) create mode 100644 src/rpc/block_header_responce.h diff --git a/src/rpc/block_header_responce.h b/src/rpc/block_header_responce.h new file mode 100644 index 000000000..c4e40c674 --- /dev/null +++ b/src/rpc/block_header_responce.h @@ -0,0 +1,38 @@ +#pragma once + +#include "serialization/keyvalue_serialization.h" + +namespace cryptonote { + struct block_header_responce + { + uint8_t major_version; + uint8_t minor_version; + uint64_t timestamp; + std::string prev_hash; + uint32_t nonce; + bool orphan_status; + uint64_t height; + uint64_t depth; + std::string hash; + difficulty_type difficulty; + uint64_t reward; + size_t tx_count; + uint64_t cumulative_difficulty; + + BEGIN_KV_SERIALIZE_MAP() + KV_SERIALIZE(major_version) + KV_SERIALIZE(minor_version) + KV_SERIALIZE(timestamp) + KV_SERIALIZE(prev_hash) + KV_SERIALIZE(nonce) + KV_SERIALIZE(orphan_status) + KV_SERIALIZE(height) + KV_SERIALIZE(depth) + KV_SERIALIZE(hash) + KV_SERIALIZE(difficulty) + KV_SERIALIZE(reward) + KV_SERIALIZE(tx_count) + KV_SERIALIZE(cumulative_difficulty) + END_KV_SERIALIZE_MAP() + }; +} diff --git a/src/rpc/core_rpc_server_commands_defs.h b/src/rpc/core_rpc_server_commands_defs.h index a71d032c2..09d604cc2 100644 --- a/src/rpc/core_rpc_server_commands_defs.h +++ b/src/rpc/core_rpc_server_commands_defs.h @@ -7,6 +7,7 @@ #include "cryptonote_core/cryptonote_basic.h" #include "cryptonote_core/difficulty.h" #include "crypto/hash.h" +#include "rpc/block_header_responce.h" #include "p2p/connection_info.h" namespace cryptonote @@ -385,39 +386,6 @@ namespace cryptonote }; }; - struct block_header_responce - { - uint8_t major_version; - uint8_t minor_version; - uint64_t timestamp; - std::string prev_hash; - uint32_t nonce; - bool orphan_status; - uint64_t height; - uint64_t depth; - std::string hash; - difficulty_type difficulty; - uint64_t reward; - size_t tx_count; - uint64_t cumulative_difficulty; - - BEGIN_KV_SERIALIZE_MAP() - KV_SERIALIZE(major_version) - KV_SERIALIZE(minor_version) - KV_SERIALIZE(timestamp) - KV_SERIALIZE(prev_hash) - KV_SERIALIZE(nonce) - KV_SERIALIZE(orphan_status) - KV_SERIALIZE(height) - KV_SERIALIZE(depth) - KV_SERIALIZE(hash) - KV_SERIALIZE(difficulty) - KV_SERIALIZE(reward) - KV_SERIALIZE(tx_count) - KV_SERIALIZE(cumulative_difficulty) - END_KV_SERIALIZE_MAP() - }; - struct COMMAND_RPC_GET_LAST_BLOCK_HEADER { typedef std::list request;