Function bitcoin::stream_blocks
source · pub async fn stream_blocks(
rpc: Arc<dyn BitcoinCoreApi + Send + Sync>,
from_height: u32,
num_confirmations: u32
) -> impl Stream<Item = Result<Block, Error>> + Unpin
Expand description
Stream blocks continuously from_height
awaiting the production of
new blocks as reported by Bitcoin core. The stream never ends.
Arguments:
rpc
- bitcoin rpcfrom_height
- height of the first block of the streamnum_confirmations
- minimum for a block to be accepted