node::WaitAndCreateNewBlock

Return a new block template when fees rise to a certain threshold or after a new tip; return nullopt if timeout is reached.

Synopsis

Declared in <node/miner.h>

std::unique_ptr<CBlockTemplate>
WaitAndCreateNewBlock(
    ChainstateManager& chainman,
    KernelNotifications& kernel_notifications,
    CTxMemPool* mempool,
    std::unique_ptr<CBlockTemplate> const& block_template,
    BlockWaitOptions const& wait_options,
    BlockCreateOptions const& create_options,
    bool& interrupt_wait);

Return Value

A new block template, or nullptr if the timeout elapsed.

Parameters

NameDescription
chainmanThe chainstate manager to build on.
kernel_notificationsThe notifications object used to wait for events.
mempoolThe mempool to draw transactions from.
block_templateThe previous template, used to compare fees.
wait_optionsOptions controlling how long to wait and the fee threshold.
create_optionsOptions controlling block-template creation.
interrupt_waitFlag that, when set, interrupts the wait.