Electroneum
cryptonote::block Struct Reference

#include <cryptonote_basic.h>

Inheritance diagram for cryptonote::block:
Collaboration diagram for cryptonote::block:

Public Member Functions

 block ()
 
 block (const block &b)
 
blockoperator= (const block &b)
 
void invalidate_hashes ()
 
bool is_hash_valid () const
 
void set_hash_valid (bool v) const
 
 if (!typename Archive< W >::is_saving()) set_hash_valid(false)
 
 if (tx_hashes.size() > CRYPTONOTE_MAX_TX_PER_BLOCK) return false
 

Public Attributes

transaction miner_tx
 
std::vector< crypto::hashtx_hashes
 
std::vector< uint8_tsignature
 
std::vector< uint8_tsignatory
 
crypto::hash hash
 
- Public Attributes inherited from cryptonote::block_header
uint8_t major_version
 
uint8_t minor_version
 
uint64_t timestamp
 
crypto::hash prev_id
 
uint32_t nonce
 

Detailed Description

Definition at line 463 of file cryptonote_basic.h.

Constructor & Destructor Documentation

◆ block() [1/2]

cryptonote::block::block ( )
inline

Definition at line 470 of file cryptonote_basic.h.

470 : block_header(), hash_valid(false) {}
Here is the caller graph for this function:

◆ block() [2/2]

cryptonote::block::block ( const block b)
inline

Definition at line 471 of file cryptonote_basic.h.

471 : block_header(b), hash_valid(false), miner_tx(b.miner_tx), tx_hashes(b.tx_hashes), signature(b.signature), signatory(b.signatory) { if (b.is_hash_valid()) { hash = b.hash; set_hash_valid(true); } }
std::vector< crypto::hash > tx_hashes
std::vector< uint8_t > signatory
void set_hash_valid(bool v) const
std::vector< uint8_t > signature
Here is the call graph for this function:

Member Function Documentation

◆ if() [1/2]

cryptonote::block::if ( !typename Archive< W >  ::is_saving())

◆ if() [2/2]

cryptonote::block::if ( tx_hashes.  size(),
CRYPTONOTE_MAX_TX_PER_BLOCK   
)

◆ invalidate_hashes()

void cryptonote::block::invalidate_hashes ( )
inline

Definition at line 473 of file cryptonote_basic.h.

473 { set_hash_valid(false); }
void set_hash_valid(bool v) const
Here is the caller graph for this function:

◆ is_hash_valid()

bool cryptonote::block::is_hash_valid ( ) const
inline

Definition at line 474 of file cryptonote_basic.h.

474 { return hash_valid.load(std::memory_order_acquire); }
Here is the caller graph for this function:

◆ operator=()

block& cryptonote::block::operator= ( const block b)
inline

Definition at line 472 of file cryptonote_basic.h.

472 { block_header::operator=(b); hash_valid = false; miner_tx = b.miner_tx; tx_hashes = b.tx_hashes; signature = b.signature; signatory = b.signatory; if (b.is_hash_valid()) { hash = b.hash; set_hash_valid(true); } return *this; }
std::vector< crypto::hash > tx_hashes
std::vector< uint8_t > signatory
void set_hash_valid(bool v) const
std::vector< uint8_t > signature
connection< TProtocol > & operator=(const connection< TProtocol > &obj)
Here is the call graph for this function:

◆ set_hash_valid()

void cryptonote::block::set_hash_valid ( bool  v) const
inline

Definition at line 475 of file cryptonote_basic.h.

475 { hash_valid.store(v,std::memory_order_release); }

Member Data Documentation

◆ hash

crypto::hash cryptonote::block::hash
mutable

Definition at line 484 of file cryptonote_basic.h.

◆ miner_tx

transaction cryptonote::block::miner_tx

Definition at line 477 of file cryptonote_basic.h.

◆ signatory

std::vector<uint8_t> cryptonote::block::signatory
mutable

Definition at line 481 of file cryptonote_basic.h.

◆ signature

std::vector<uint8_t> cryptonote::block::signature
mutable

Definition at line 480 of file cryptonote_basic.h.

◆ tx_hashes

std::vector<crypto::hash> cryptonote::block::tx_hashes

Definition at line 478 of file cryptonote_basic.h.


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