Move block_header_responce into its own file

This commit is contained in:
Zachary Michaels 2014-06-26 14:23:47 -04:00
parent 760c1e3890
commit 62a63ea382
2 changed files with 39 additions and 33 deletions

View File

@ -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()
};
}

View File

@ -7,6 +7,7 @@
#include "cryptonote_core/cryptonote_basic.h" #include "cryptonote_core/cryptonote_basic.h"
#include "cryptonote_core/difficulty.h" #include "cryptonote_core/difficulty.h"
#include "crypto/hash.h" #include "crypto/hash.h"
#include "rpc/block_header_responce.h"
#include "p2p/connection_info.h" #include "p2p/connection_info.h"
namespace cryptonote 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 struct COMMAND_RPC_GET_LAST_BLOCK_HEADER
{ {
typedef std::list<std::string> request; typedef std::list<std::string> request;