global: MASSIVE snapshot

This commit is contained in:
nym21
2026-01-07 01:16:37 +01:00
parent e832ffbe23
commit cb0abc324e
487 changed files with 21155 additions and 13627 deletions

View File

@@ -1,23 +1,14 @@
use std::ops::Deref;
use brk_types::{AddressBytes, AddressMempoolStats, Transaction, Txid};
use derive_more::Deref;
use rustc_hash::{FxHashMap, FxHashSet};
/// Per-address stats with associated transaction set.
pub type AddressStats = (AddressMempoolStats, FxHashSet<Txid>);
/// Tracks per-address mempool statistics.
#[derive(Default)]
#[derive(Default, Deref)]
pub struct AddressTracker(FxHashMap<AddressBytes, AddressStats>);
impl Deref for AddressTracker {
type Target = FxHashMap<AddressBytes, AddressStats>;
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl AddressTracker {
/// Add a transaction to address tracking.
pub fn add_tx(&mut self, tx: &Transaction, txid: &Txid) {

View File

@@ -10,7 +10,7 @@ use std::{
use brk_error::Result;
use brk_rpc::Client;
use brk_types::{MempoolEntryInfo, MempoolInfo, TxWithHex, Txid, TxidPrefix};
use derive_deref::Deref;
use derive_more::Deref;
use log::error;
use parking_lot::{RwLock, RwLockReadGuard};
use rustc_hash::FxHashMap;

View File

@@ -1,20 +1,11 @@
use std::ops::Deref;
use brk_types::{TxWithHex, Txid};
use derive_more::Deref;
use rustc_hash::FxHashMap;
/// Store of full transaction data for API access.
#[derive(Default)]
#[derive(Default, Deref)]
pub struct TxStore(FxHashMap<Txid, TxWithHex>);
impl Deref for TxStore {
type Target = FxHashMap<Txid, TxWithHex>;
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl TxStore {
/// Check if a transaction exists.
pub fn contains(&self, txid: &Txid) -> bool {