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

Detailed Description

Definition at line 47 of file block.hpp.

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

Public Member Functions

 Block (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::btc::BlockHeader
 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

std::vector< Transactionvtx {}
 
 ADD_SERIALIZE_METHODS
 
- Public Attributes inherited from altintegration::btc::BlockHeader
 ADD_SERIALIZE_METHODS
 

Friends

bool operator== (const Block &a, const Block &b)
 
bool operator!= (const Block &a, const Block &b)
 

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

◆ Block()

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

Definition at line 52 of file block.hpp.

58 : BlockHeader(version,
59 std::move(previousBlock),
60 std::move(merkleRoot),
61 timestamp,
62 bits,
63 nonce) {}

Member Function Documentation

◆ SerializationOp()

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

Definition at line 68 of file block.hpp.

68 {
69 READWRITEAS(BlockHeader, *this);
70 READWRITE(this->vtx);
71 }

Friends And Related Function Documentation

◆ operator!=

bool operator!= ( const Block a,
const Block b 
)
friend

Definition at line 79 of file block.hpp.

79{ return !(a == b); }

◆ operator==

bool operator== ( const Block a,
const Block b 
)
friend

Definition at line 73 of file block.hpp.

73 {
74 const BlockHeader& A = a;
75 const BlockHeader& B = b;
76 return A == B && a.vtx == b.vtx;
77 }

Member Data Documentation

◆ ADD_SERIALIZE_METHODS

altintegration::btc::Block::ADD_SERIALIZE_METHODS

Definition at line 65 of file block.hpp.

◆ vtx

std::vector<Transaction> altintegration::btc::Block::vtx {}

Definition at line 48 of file block.hpp.


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