pub struct SimpleMiner { /* private fields */ }Expand description
Mining block template provider with mempool-aware transaction selection and correct halving-based subsidy calculation.
Implementations§
Source§impl SimpleMiner
impl SimpleMiner
Sourcepub fn with_mempool(mempool: Arc<dyn MempoolPort>) -> Self
pub fn with_mempool(mempool: Arc<dyn MempoolPort>) -> Self
Create a new miner with mempool access for transaction selection
Sourcepub async fn set_height(&self, height: u32)
pub async fn set_height(&self, height: u32)
Set the current block height
Sourcepub async fn set_best_block_hash(&self, hash: BlockHash)
pub async fn set_best_block_hash(&self, hash: BlockHash)
Set the best block hash
Trait Implementations§
Source§impl BlockTemplateProvider for SimpleMiner
impl BlockTemplateProvider for SimpleMiner
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,
Creates a block template ready for mining. Read more
Auto Trait Implementations§
impl Freeze for SimpleMiner
impl !RefUnwindSafe for SimpleMiner
impl Send for SimpleMiner
impl Sync for SimpleMiner
impl Unpin for SimpleMiner
impl UnsafeUnpin for SimpleMiner
impl !UnwindSafe for SimpleMiner
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