mirror of
https://github.com/bitcoinresearchkit/brk.git
synced 2026-07-20 07:28:11 -07:00
global: snapshot
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
use std::hash::{DefaultHasher, Hash, Hasher};
|
||||
|
||||
use brk_types::RecommendedFees;
|
||||
|
||||
use super::{fees, stats::{self, BlockStats}};
|
||||
@@ -36,4 +38,14 @@ impl Snapshot {
|
||||
fees,
|
||||
}
|
||||
}
|
||||
|
||||
/// Hash of the first projected block (the one about to be mined).
|
||||
pub fn next_block_hash(&self) -> u64 {
|
||||
let Some(block) = self.blocks.first() else {
|
||||
return 0;
|
||||
};
|
||||
let mut hasher = DefaultHasher::new();
|
||||
block.hash(&mut hasher);
|
||||
hasher.finish()
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user