pub struct ReorgMonitor { /* private fields */ }Expand description
Chain tip tracker for detecting blockchain reorganizations
Implementations§
Source§impl ReorgMonitor
impl ReorgMonitor
Sourcepub fn update_tip(
&mut self,
chain: &str,
height: u64,
tip_hash: [u8; 32],
) -> Option<ReorgEvent>
pub fn update_tip( &mut self, chain: &str, height: u64, tip_hash: [u8; 32], ) -> Option<ReorgEvent>
Update the chain tip. Returns Some(ReorgEvent) if a reorg is detected.
Sourcepub fn handle_reorg(
&self,
event: &ReorgEvent,
store: &mut dyn SealStore,
) -> Result<usize, StoreError>
pub fn handle_reorg( &self, event: &ReorgEvent, store: &mut dyn SealStore, ) -> Result<usize, StoreError>
Roll back anchors and seals after a reorg
Sourcepub fn recent_reorgs(&self, chain: &str) -> Vec<&ReorgEvent>
pub fn recent_reorgs(&self, chain: &str) -> Vec<&ReorgEvent>
Get recent reorgs for a specific chain
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ReorgMonitor
impl RefUnwindSafe for ReorgMonitor
impl Send for ReorgMonitor
impl Sync for ReorgMonitor
impl Unpin for ReorgMonitor
impl UnsafeUnpin for ReorgMonitor
impl UnwindSafe for ReorgMonitor
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