global: fixes

This commit is contained in:
nym21
2026-05-04 16:57:21 +02:00
parent 4663d13194
commit dc32bd480f
121 changed files with 2996 additions and 2165 deletions
@@ -5,10 +5,15 @@ use super::block_window::BlockWindow;
use crate::Query;
impl Query {
/// Time-bucketed average block rewards (subsidy + fees) over
/// `time_period`. One entry per bucket, ordered chronologically. Each
/// entry carries the bucket's average height/timestamp, the round-half-up
/// mean of coinbase rewards in sats, and the bucket-mean USD spot price
/// (the spot price, not rewards-in-USD: clients multiply).
pub fn block_rewards(&self, time_period: TimePeriod) -> Result<Vec<BlockRewardsEntry>> {
let bw = BlockWindow::new(self, time_period);
let rewards: Vec<Sats> = bw.read(&self.computer().mining.rewards.coinbase.block.sats);
let prices: Vec<Cents> = bw.read(&self.computer().prices.spot.cents.height);
let bw = BlockWindow::new(self, time_period)?;
let rewards: Vec<Sats> = bw.read(&self.computer().mining.rewards.coinbase.block.sats)?;
let prices: Vec<Cents> = bw.read(&self.computer().prices.spot.cents.height)?;
Ok(bw
.buckets