71 std::map<PbftPeriod, std::vector<std::shared_ptr<PbftBlock>>>
getProposedBlocks()
const;
75 std::map<PbftPeriod, std::unordered_map<blk_hash_t, std::pair<std::shared_ptr<PbftBlock>,
bool>>>
proposed_blocks_;
77 std::shared_ptr<DbStorage>
db_;
class ProposedBlocks holds proposed pbft blocks together with propose votes hashes per period & round
Definition proposed_blocks.hpp:18
void cleanupProposedPbftBlocksByPeriod(PbftPeriod period)
Cleanup all proposed PBFT blocks for the finalized period.
Definition proposed_blocks.cpp:64
ProposedBlocks(std::shared_ptr< DbStorage > db)
Definition proposed_blocks.hpp:20
bool pushProposedPbftBlock(const std::shared_ptr< PbftBlock > &proposed_block, bool save_to_db=true)
Push proposed PBFT block into the proposed blocks.
Definition proposed_blocks.cpp:8
std::optional< std::string > checkOldBlocksPresence(PbftPeriod current_period) const
Check if there are any old proposed blocks that were supposed to be deleted.
Definition proposed_blocks.cpp:77
std::map< PbftPeriod, std::unordered_map< blk_hash_t, std::pair< std::shared_ptr< PbftBlock >, bool > > > proposed_blocks_
Definition proposed_blocks.hpp:75
void markBlockAsValid(const std::shared_ptr< PbftBlock > &proposed_block)
Mark block as valid - no need to validate it again.
Definition proposed_blocks.cpp:25
std::optional< std::pair< std::shared_ptr< PbftBlock >, bool > > getPbftProposedBlock(PbftPeriod period, const blk_hash_t &block_hash) const
Get a proposed PBFT block based on specified period and block hash.
Definition proposed_blocks.cpp:36
std::shared_mutex proposed_blocks_mutex_
Definition proposed_blocks.hpp:76
std::map< PbftPeriod, std::vector< std::shared_ptr< PbftBlock > > > getProposedBlocks() const
Definition proposed_blocks.cpp:87
bool isInProposedBlocks(PbftPeriod period, const blk_hash_t &block_hash) const
Check if specified block is already in proposed blocks.
Definition proposed_blocks.cpp:53
std::shared_ptr< DbStorage > db_
Definition proposed_blocks.hpp:77
EthBlockNumber PbftPeriod
Definition types.hpp:25