zebrad::components::miner

Function generate_block_templates

source
pub async fn generate_block_templates<Mempool, State, Tip, BlockVerifierRouter, SyncStatus, AddressBook>(
    network: Network,
    rpc: GetBlockTemplateRpcImpl<Mempool, State, Tip, BlockVerifierRouter, SyncStatus, AddressBook>,
    template_sender: Sender<Option<Arc<Block>>>,
) -> Result<(), Report>
where Mempool: Service<Request, Response = Response, Error = BoxError> + Clone + Send + Sync + 'static, Mempool::Future: Send, State: Service<ReadRequest, Response = ReadResponse, Error = BoxError> + Clone + Send + Sync + 'static, <State as Service<ReadRequest>>::Future: Send, Tip: ChainTip + Clone + Send + Sync + 'static, BlockVerifierRouter: Service<Request, Response = Hash, Error = BoxError> + Clone + Send + Sync + 'static, <BlockVerifierRouter as Service<Request>>::Future: Send, SyncStatus: ChainSyncStatus + Clone + Send + Sync + 'static, AddressBook: AddressBookPeers + Clone + Send + Sync + 'static,
Expand description

Generates block templates using rpc, and sends them to mining threads using template_sender.