mirror of
https://github.com/bitcoinresearchkit/brk.git
synced 2026-04-25 07:09:59 -07:00
general: snapshot
This commit is contained in:
@@ -59,6 +59,7 @@ impl AddressData {
|
||||
self.outputs_len -= 1;
|
||||
|
||||
let previous_sent_dollar_value = previous_price * amount;
|
||||
|
||||
self.realized_cap -= previous_sent_dollar_value;
|
||||
|
||||
Ok(())
|
||||
|
||||
@@ -15,11 +15,3 @@ impl BlockPath {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl std::hash::Hash for BlockPath {
|
||||
fn hash<H: std::hash::Hasher>(&self, hasher: &mut H) {
|
||||
hasher.write_u32(((self.date_index as u32) << 16_u32) + self.block_index as u32)
|
||||
}
|
||||
}
|
||||
|
||||
// impl nohash::IsEnabled for BlockPath {}
|
||||
|
||||
@@ -19,6 +19,7 @@ where
|
||||
Key: MapKey<ChunkId>,
|
||||
Value: MapValue,
|
||||
{
|
||||
#[inline(always)]
|
||||
fn new(version: u32) -> Self {
|
||||
Self {
|
||||
version,
|
||||
@@ -30,14 +31,17 @@ where
|
||||
Some(Key::from_usize(chunk_id.to_usize() + self.map.len()))
|
||||
}
|
||||
|
||||
#[inline(always)]
|
||||
fn version(&self) -> u32 {
|
||||
self.version
|
||||
}
|
||||
|
||||
#[inline(always)]
|
||||
fn get(&self, serialized_key: &Key) -> Option<&Value> {
|
||||
self.map.get(serialized_key.to_usize())
|
||||
}
|
||||
|
||||
#[inline(always)]
|
||||
fn last(&self) -> Option<&Value> {
|
||||
self.map.last()
|
||||
}
|
||||
|
||||
@@ -12,6 +12,7 @@ pub struct TxData {
|
||||
direct_repr!(TxData);
|
||||
|
||||
impl TxData {
|
||||
#[inline(always)]
|
||||
pub fn new(index: u32, block_path: BlockPath, utxos: u16) -> Self {
|
||||
Self {
|
||||
index,
|
||||
|
||||
@@ -10,19 +10,13 @@ pub struct TxoutIndex {
|
||||
direct_repr!(TxoutIndex);
|
||||
|
||||
impl TxoutIndex {
|
||||
#[inline(always)]
|
||||
pub fn new(tx_index: u32, vout: u16) -> Self {
|
||||
Self { tx_index, vout }
|
||||
}
|
||||
|
||||
#[inline(always)]
|
||||
pub fn as_u64(&self) -> u64 {
|
||||
((self.tx_index as u64) << 16_u64) + self.vout as u64
|
||||
}
|
||||
}
|
||||
|
||||
impl std::hash::Hash for TxoutIndex {
|
||||
fn hash<H: std::hash::Hasher>(&self, hasher: &mut H) {
|
||||
hasher.write_u64(self.as_u64())
|
||||
}
|
||||
}
|
||||
|
||||
// impl nohash::IsEnabled for TxoutIndex {}
|
||||
|
||||
Reference in New Issue
Block a user