waterfalls 0.9.2

Waterfalls provide blockchain data to liquid and bitcoin light-client wallets
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use std::sync::Arc;

use crate::{server::Error, server::State, store::Store};

pub async fn headers(state: Arc<State>) -> Result<(), Error> {
    let mut blocks_hash_ts = state.blocks_hash_ts.lock().await;
    let mut i = 0usize;
    for meta in state.store.iter_hash_ts() {
        assert_eq!(i as u32, meta.height());
        blocks_hash_ts.push((meta.hash(), meta.timestamp()));
        i += 1;
    }
    log::info!("{i} block meta preloaded");

    Ok(())
}