pub struct Tracker { /* private fields */ }Expand description
A host’s tracked transactions, with indexes for targeted chain events. Hints, ages and spend attempts name one transaction. A tip uses only the suspect set; reorgs and forks use only the relevant mined height range.
Implementations§
Source§impl Tracker
impl Tracker
Sourcepub fn track(&mut self, txid: impl Into<TxId>) -> &State
pub fn track(&mut self, txid: impl Into<TxId>) -> &State
Begin tracking one transaction; repeating this does not erase its state.
Sourcepub fn get(&self, txid: &str) -> Option<&State>
pub fn get(&self, txid: &str) -> Option<&State>
An immutable state, or none when the host does not track this txid.
Sourcepub fn apply<H: Headers + ?Sized>(
&mut self,
txid: &str,
headers: &H,
input: Input,
) -> Result<(), CheckError>
pub fn apply<H: Headers + ?Sized>( &mut self, txid: &str, headers: &H, input: Input, ) -> Result<(), CheckError>
Apply an input to one transaction and maintain the event indexes, including after a failed proof or header lookup.
Sourcepub fn on_chain<H: Headers + ?Sized>(
&mut self,
headers: &H,
event: ChainEvent,
) -> Vec<ChainUpdate>
pub fn on_chain<H: Headers + ?Sized>( &mut self, headers: &H, event: ChainEvent, ) -> Vec<ChainUpdate>
Deliver an evidence event only to the set it names. The output contains every selected txid and each fault for the host to report.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Tracker
impl RefUnwindSafe for Tracker
impl Send for Tracker
impl Sync for Tracker
impl Unpin for Tracker
impl UnsafeUnpin 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