CatapultServer  v0.5.0.1 (Elephant)
catapult::harvesting::Harvester Class Reference

A class that creates new blocks. More...

Collaboration diagram for catapult::harvesting::Harvester:

Public Member Functions

 Harvester (const cache::CatapultCache &cache, const model::BlockChainConfiguration &config, const Key &beneficiary, const UnlockedAccounts &unlockedAccounts, const BlockGenerator &blockGenerator)
 
std::unique_ptr< model::Blockharvest (const model::BlockElement &lastBlockElement, Timestamp timestamp)
 

Private Attributes

const cache::CatapultCachem_cache
 
const model::BlockChainConfiguration m_config
 
const Key m_beneficiary
 
const UnlockedAccountsm_unlockedAccounts
 
BlockGenerator m_blockGenerator
 

Detailed Description

A class that creates new blocks.

Constructor & Destructor Documentation

◆ Harvester()

catapult::harvesting::Harvester::Harvester ( const cache::CatapultCache cache,
const model::BlockChainConfiguration config,
const Key beneficiary,
const UnlockedAccounts unlockedAccounts,
const BlockGenerator blockGenerator 
)
explicit

Creates a harvester around a catapult cache, a block chain config, a beneficiary, an unlocked accounts set (unlockedAccounts) and blockGenerator used to customize block generation.

Member Function Documentation

◆ harvest()

std::unique_ptr< model::Block > catapult::harvesting::Harvester::harvest ( const model::BlockElement lastBlockElement,
Timestamp  timestamp 
)

Creates the best block (if any) harvested by any unlocked account. Created block will have lastBlockElement as parent and timestamp as timestamp.

Here is the call graph for this function:

Member Data Documentation

◆ m_beneficiary

const Key catapult::harvesting::Harvester::m_beneficiary
private

◆ m_blockGenerator

BlockGenerator catapult::harvesting::Harvester::m_blockGenerator
private

◆ m_cache

const cache::CatapultCache& catapult::harvesting::Harvester::m_cache
private

◆ m_config

const model::BlockChainConfiguration catapult::harvesting::Harvester::m_config
private

◆ m_unlockedAccounts

const UnlockedAccounts& catapult::harvesting::Harvester::m_unlockedAccounts
private

The documentation for this class was generated from the following files: