pub struct BlockAssembler { /* private fields */ }Expand description
Block template assembler.
Holds references to the chain state (for tip/height/bits) and mempool
(for transaction selection). Implements BlockTemplateProvider to assemble
block templates from mempool transactions for mining.
Implementations§
Source§impl BlockAssembler
impl BlockAssembler
Sourcepub fn new(
chain_state: Arc<dyn ChainStateStore>,
mempool: Arc<dyn MempoolPort>,
) -> Self
pub fn new( chain_state: Arc<dyn ChainStateStore>, mempool: Arc<dyn MempoolPort>, ) -> Self
Create a new block assembler.
Trait Implementations§
Source§impl BlockTemplateProvider for BlockAssembler
impl BlockTemplateProvider for BlockAssembler
Source§fn create_block_template<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
coinbase_script: &'life1 Script,
params: &'life2 ConsensusParams,
) -> Pin<Box<dyn Future<Output = Result<BlockTemplate, Box<dyn Error + Send + Sync>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn create_block_template<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
coinbase_script: &'life1 Script,
params: &'life2 ConsensusParams,
) -> Pin<Box<dyn Future<Output = Result<BlockTemplate, Box<dyn Error + Send + Sync>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Create a block template by selecting mempool transactions and building a valid block structure ready for mining.
Auto Trait Implementations§
impl Freeze for BlockAssembler
impl !RefUnwindSafe for BlockAssembler
impl Send for BlockAssembler
impl Sync for BlockAssembler
impl Unpin for BlockAssembler
impl UnsafeUnpin for BlockAssembler
impl !UnwindSafe for BlockAssembler
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more