website_next: snapshot

This commit is contained in:
nym21
2026-07-04 22:09:40 +02:00
parent a99c06013b
commit 0bf2cd77dc
5 changed files with 295 additions and 180 deletions
+8 -1
View File
@@ -208,6 +208,7 @@ impl Query {
let computer = self.computer();
let reader = self.reader();
let all_pools = pools();
let pool_heights = computer.pools.pool_heights.read();
// Bulk read all indexed data
let blockhashes = indexer.vecs.blocks.blockhash.collect_range_at(begin, end);
@@ -398,6 +399,11 @@ impl Query {
let pool_slug = pool_slugs[i];
let pool = all_pools.get(pool_slug);
let height = begin + i;
let block_number = pool_heights
.get(&pool_slug)
.map(|heights| heights.partition_point(|h| h.to_usize() <= height) as u64)
.unwrap_or(0);
let miner_names = if pool_slug == PoolSlug::Ocean {
Self::parse_datum_miner_names(&scriptsig_bytes)
@@ -410,7 +416,7 @@ impl Query {
let info = BlockInfo {
id: blockhashes[i],
height: Height::from(begin + i),
height: Height::from(height),
version: header.version,
timestamp: timestamps[i],
bits: header.bits,
@@ -444,6 +450,7 @@ impl Query {
id: pool.mempool_unique_id(),
name: pool.name.to_string(),
slug: pool_slug,
block_number,
miner_names,
},
avg_fee: Sats::from(total_fees_u64.checked_div(non_coinbase).unwrap_or(0)),
+4
View File
@@ -18,6 +18,10 @@ pub struct BlockPool {
/// URL-friendly pool identifier
pub slug: PoolSlug,
/// This block's ordinal among blocks attributed to this pool
#[schemars(example = 215_000)]
pub block_number: u64,
/// Miner name tags found in coinbase scriptsig
pub miner_names: Option<Vec<String>>,
}