5#ifndef BITCOIN_NODE_BLOCK_TEMPLATE_MANAGER_H
6#define BITCOIN_NODE_BLOCK_TEMPLATE_MANAGER_H
25class KernelNotifications;
54 bool SubmitBlock(
const std::shared_ptr<const CBlock>& block, std::string& reason, std::string& debug);
58 std::optional<interfaces::BlockRef>
GetTip();
99 const std::unique_ptr<CBlockTemplate>& block_template,
102 bool& interrupt_wait);
CTxMemPool stores valid-according-to-the-current-best-chain transactions that may be included in the ...
Interface for managing multiple Chainstate objects, where each chainstate is associated with chainsta...
Creates block templates, submits solved blocks, and provides tip-waiting helpers for mining code.
BlockTemplateManager(CTxMemPool &mempool, ChainstateManager &chainman, KernelNotifications ¬ifications, BlockCreateOptions block_create_args={})
std::optional< interfaces::BlockRef > WaitTipChanged(const uint256 ¤t_tip, MillisecondsDouble &timeout, bool &interrupt)
Wait for the tip to differ from current_tip or timeout.
std::unique_ptr< CBlockTemplate > CreateNewTemplate(const BlockCreateOptions &options)
Create a fresh block template, applying init-time defaults to any unset options.
const BlockCreateOptions & BlockCreateArgs() const
bool SubmitBlock(const std::shared_ptr< const CBlock > &block, std::string &reason, std::string &debug)
Submit a block via ProcessNewBlock and capture validation state.
std::optional< interfaces::BlockRef > GetTip()
Locks cs_main.
const BlockCreateOptions m_block_create_args
ChainstateManager & m_chainman
KernelNotifications & m_notifications
void InterruptWait(bool &interrupt_wait)
Interrupt a blocking wait.
std::unique_ptr< CBlockTemplate > WaitAndCreateNewBlock(const std::unique_ptr< CBlockTemplate > &block_template, const BlockWaitOptions &wait_options, const BlockCreateOptions &create_options, bool &interrupt_wait)
Return a new block template when fees rise to a certain threshold or after a new tip; return nullptr ...
bool CooldownIfHeadersAhead(const interfaces::BlockRef &last_tip, bool &interrupt_mining)
Wait while the best known header extends the current chain tip AND at least one block is being added ...
is used externally by mining IPC clients, so it should only declare simple data definitions.
Hash/height pair to help track and identify blocks.
Block template creation options.
std::chrono::duration< double, std::chrono::milliseconds::period > MillisecondsDouble