[#node-WaitAndCreateNewBlock] = xref:node.adoc[node]::WaitAndCreateNewBlock :relfileprefix: ../ :mrdocs: 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>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- std::unique_ptr<CBlockTemplate> WaitAndCreateNewBlock( xref:ChainstateManager.adoc[ChainstateManager]& chainman, xref:node/KernelNotifications.adoc[KernelNotifications]& kernel_notifications, xref:CTxMemPool.adoc[CTxMemPool]* mempool, std::unique_ptr<CBlockTemplate> const& block_template, xref:node/BlockWaitOptions.adoc[BlockWaitOptions] const& wait_options, xref:node/BlockCreateOptions.adoc[BlockCreateOptions] const& create_options, bool& interrupt_wait); ---- == Return Value A new block template, or nullptr if the timeout elapsed. == Parameters [cols="1,4"] |=== | Name| Description | *chainman* | The chainstate manager to build on. | *kernel_notifications* | The notifications object used to wait for events. | *mempool* | The mempool to draw transactions from. | *block_template* | The previous template, used to compare fees. | *wait_options* | Options controlling how long to wait and the fee threshold. | *create_options* | Options controlling block‐template creation. | *interrupt_wait* | Flag that, when set, interrupts the wait. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#