6 #ifndef FABCOIN_PRIMITIVES_BLOCK_H 7 #define FABCOIN_PRIMITIVES_BLOCK_H 17 static const int SER_WITHOUT_SIGNATURE = 1 << 3;
22 static const int SERIALIZE_BLOCK_LEGACY = 0x04000000;
23 static const int SERIALIZE_BLOCK_NO_CONTRACT = 0x08000000;
39 static const size_t HEADER_SIZE = 4+32+32+4+28+4+4+32;
40 static const size_t HEADER_NEWSIZE = 4+32+32+4+28+4+4+32+32+32;
47 uint32_t nReserved[7];
63 template <
typename Stream,
typename Operation>
71 if ( !( s.GetVersion() & SERIALIZE_BLOCK_LEGACY ) )
74 bool equihash_format = ! ( (s.GetVersion() & SERIALIZE_BLOCK_LEGACY) ||
_IsLegacyFormat(nHeight) );
76 if (equihash_format) {
77 for(
size_t i = 0; i < (
sizeof(nReserved) /
sizeof(nReserved[0])); i++) {
90 if (equihash_format) {
94 uint32_t legacy_nonce = (uint32_t)nNonce.
GetUint64(0);
111 memset(nReserved, 0,
sizeof(nReserved));
125 uint256 GetHashWithoutSign()
const;
129 return (int64_t)nTime;
140 this->nTime = other.
nTime;
141 this->nBits = other.
nBits;
144 this->nNonce = other.
nNonce;
151 std::string ToString()
const;
159 std::vector<CTransactionRef>
vtx;
177 template <
typename Stream,
typename Operation>
208 std::string ToString()
const;
227 template <
typename Stream,
typename Operation>
234 for (
size_t i = 0; i < (
sizeof(nReserved) /
sizeof(nReserved[0])); i++) {
257 explicit CBlockLocator(
const std::vector<uint256>& vHaveIn) : vHave(vHaveIn) {}
261 template <
typename Stream,
typename Operation>
263 int nVersion = s.GetVersion();
276 return vHave.empty();
281 #endif // FABCOIN_PRIMITIVES_BLOCK_H
Describes a place in the block chain to another node such that if the other node doesn't have the sam...
CBlock(const CBlockHeader &header)
void SerializationOp(Stream &s, Operation ser_action)
bool _IsSupportContract(int nVersion, int nHeight)
uint64_t GetUint64(int pos) const
void SerializationOp(Stream &s, Operation ser_action)
CBlockHeader GetBlockHeader() const
bool _IsLegacyFormat(int nHeight)
std::vector< uint256 > vHave
Parameters that influence chain consensus.
CBlockLocator(const std::vector< uint256 > &vHaveIn)
256-bit unsigned big integer.
uint256 ArithToUint256(const arith_uint256 &a)
std::vector< CTransactionRef > vtx
const CChainParams & Params()
Return the currently selected parameters.
void * memcpy(void *a, const void *b, size_t c)