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 rpc
  • from_height - height of the first block of the stream
  • num_confirmations - minimum for a block to be accepted