pub struct Tracker { /* private fields */ }Implementations§
Source§impl Tracker
impl Tracker
pub fn new(mempool_path: &Path, metrics: &Metrics) -> Tracker
pub async fn get_txn(&self, txid: &Txid) -> Option<Transaction>
pub async fn get_all_txn(&self) -> Vec<Txid>
pub async fn get_txn_partially_matching_scriptsig( &self, scriptsig: &[u8], ) -> Vec<Txid>
pub async fn has_txn(&self, txid: &Txid) -> bool
pub async fn get_fee(&self, txid: &Txid) -> Option<u64>
pub async fn get_count(&self) -> usize
pub async fn contains_funding_tx(&self, prevout: &OutPoint) -> bool
Sourcepub async fn fee_histogram(&self) -> Vec<(f32, u32)>
pub async fn fee_histogram(&self) -> Vec<(f32, u32)>
Returns vector of (fee_rate, vsize) pairs, where fee_{n-1} > fee_n and vsize_n is the total virtual size of mempool transactions with fee in the bin [fee_{n-1}, fee_n]. Note: fee_{-1} is implied to be infinite.
pub fn index(&self) -> &Arc<DBStore>
Sourcepub async fn update_from_tx(
&self,
tx: Transaction,
txquery: &TxQuery,
) -> Result<()>
pub async fn update_from_tx( &self, tx: Transaction, txquery: &TxQuery, ) -> Result<()>
Called when we have a transaction and can assume we have its parents in mempool already.
Sourcepub async fn update_from_txids(
&self,
tx_invs: HashSet<Txid>,
txquery: &TxQuery,
) -> HashSet<Txid>
pub async fn update_from_txids( &self, tx_invs: HashSet<Txid>, txquery: &TxQuery, ) -> HashSet<Txid>
Add any new transaction batch provided via p2p network to our mempool.
Sourcepub async fn update_from_daemon(
&self,
daemon: &Daemon,
txquery: &TxQuery,
) -> Result<HashSet<Txid>>
pub async fn update_from_daemon( &self, daemon: &Daemon, txquery: &TxQuery, ) -> Result<HashSet<Txid>>
Find full difference in mempool, the daemon is the master, so any transactions they don’t have, but we have, we’ll remove.
pub async fn tx_confirmation_state( &self, txid: &Txid, height: Option<u32>, ) -> ConfirmationState
Auto Trait Implementations§
impl !Freeze for Tracker
impl !RefUnwindSafe for Tracker
impl Send for Tracker
impl Sync for Tracker
impl Unpin for Tracker
impl !UnwindSafe for Tracker
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more