veriblock-pop-cpp
C++11 Libraries for leveraging VeriBlock Proof-Of-Proof blockchain technology.
altintegration::btc::BlockHeader Struct Reference

Detailed Description

Definition at line 18 of file block.hpp.

+ Inheritance diagram for altintegration::btc::BlockHeader:
+ Collaboration diagram for altintegration::btc::BlockHeader:

Public Member Functions

 BlockHeader (int32_t version, uint256 previousBlock, uint256 merkleRoot, uint32_t timestamp, uint32_t bits, uint32_t nonce)
 
template<typename Stream , typename Operation >
void SerializationOp (Stream &s, Operation ser_action)
 
- Public Member Functions inherited from altintegration::BtcBlock
 BtcBlock (int32_t version, uint256 previousBlock, uint256 merkleRoot, uint32_t timestamp, uint32_t bits, uint32_t nonce)
 
void toRaw (WriteStream &stream) const
 Convert BtcBlock to data stream using BtcBlock basic byte format. More...
 
void toVbkEncoding (WriteStream &stream) const
 Convert BtcBlock to data stream using BtcBlock VBK byte format. More...
 
size_t estimateSize () const
 
hash_t calculateHash () const
 
const hash_tgetHash () const
 Calculate the hash of the btc block. More...
 
std::string toPrettyString () const
 
int32_t getVersion () const
 
uint256 getPreviousBlock () const
 
uint256 getMerkleRoot () const
 
uint32_t getNonce () const
 
uint32_t getTimestamp () const
 
uint32_t getDifficulty () const
 
void setVersion (int32_t v)
 
void setPreviousBlock (const uint256 &prev)
 
void setMerkleRoot (const uint256 &mr)
 
void setDifficulty (uint32_t bits)
 
void setNonce (uint32_t nnc)
 
void setTimestamp (uint32_t ts)
 

Public Attributes

 ADD_SERIALIZE_METHODS
 

Additional Inherited Members

- Public Types inherited from altintegration::BtcBlock
using hash_t = uint256
 
using prev_hash_t = uint256
 
using height_t = int32_t
 
using nonce_t = uint32_t
 
using merkle_t = uint256
 
using addon_t = StoredBtcBlockAddon::addon_t
 
using stored_addon_t = StoredBtcBlockAddon
 
- Static Public Member Functions inherited from altintegration::BtcBlock
static const std::string & name ()
 
- Protected Member Functions inherited from altintegration::BtcBlock
void invalidateHash () const
 
- Protected Attributes inherited from altintegration::BtcBlock
int32_t version = 0
 
uint256 previousBlock {}
 
uint256 merkleRoot {}
 
uint32_t timestamp = 0
 
uint32_t bits = 0
 
uint32_t nonce = 0
 
hash_t hash_
 
- Static Protected Attributes inherited from altintegration::BtcBlock
static const std::string _name
 

Constructor & Destructor Documentation

◆ BlockHeader()

altintegration::btc::BlockHeader::BlockHeader ( int32_t  version,
uint256  previousBlock,
uint256  merkleRoot,
uint32_t  timestamp,
uint32_t  bits,
uint32_t  nonce 
)
inline

Definition at line 21 of file block.hpp.

27 : BtcBlock(version,
28 std::move(previousBlock),
29 std::move(merkleRoot),
30 timestamp,
31 bits,
32 nonce) {}

Member Function Documentation

◆ SerializationOp()

template<typename Stream , typename Operation >
void altintegration::btc::BlockHeader::SerializationOp ( Stream &  s,
Operation  ser_action 
)
inline

Definition at line 37 of file block.hpp.

37 {
38 READWRITE(this->version);
39 READWRITE(this->previousBlock);
40 READWRITE(this->merkleRoot);
41 READWRITE(this->timestamp);
42 READWRITE(this->bits);
43 READWRITE(this->nonce);
44 }

Member Data Documentation

◆ ADD_SERIALIZE_METHODS

altintegration::btc::BlockHeader::ADD_SERIALIZE_METHODS

Definition at line 34 of file block.hpp.


The documentation for this struct was generated from the following file: