pub struct TaskReorg { /* private fields */ }Expand description
Background task that handles chain reorg processing.
Processes deactivated block headers by finding ProvenTx records that reference those blocks and attempting to get updated merkle proofs. Uses an aging pattern to delay processing, allowing the chain to stabilize.
Implementations§
Source§impl TaskReorg
impl TaskReorg
Sourcepub fn new(
storage: WalletStorageManager,
services: Arc<dyn WalletServices>,
deactivated_headers: Arc<Mutex<Vec<DeactivatedHeader>>>,
) -> Self
pub fn new( storage: WalletStorageManager, services: Arc<dyn WalletServices>, deactivated_headers: Arc<Mutex<Vec<DeactivatedHeader>>>, ) -> Self
Create a new TaskReorg with default intervals.
Sourcepub fn with_intervals(
storage: WalletStorageManager,
services: Arc<dyn WalletServices>,
deactivated_headers: Arc<Mutex<Vec<DeactivatedHeader>>>,
aged_msecs: u64,
max_retries: u32,
trigger_msecs: u64,
) -> Self
pub fn with_intervals( storage: WalletStorageManager, services: Arc<dyn WalletServices>, deactivated_headers: Arc<Mutex<Vec<DeactivatedHeader>>>, aged_msecs: u64, max_retries: u32, trigger_msecs: u64, ) -> Self
Create with custom intervals.
Trait Implementations§
Source§impl WalletMonitorTask for TaskReorg
impl WalletMonitorTask for TaskReorg
Source§fn trigger(&mut self, now_msecs_since_epoch: u64) -> bool
fn trigger(&mut self, now_msecs_since_epoch: u64) -> bool
Return true if
run_task needs to be called now.
This is NOT async – it must be a fast, synchronous check.Source§fn run_task<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<String, WalletError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn run_task<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<String, WalletError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Execute the task’s work. Returns a log string describing what was done.
Source§fn async_setup<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<(), WalletError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn async_setup<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<(), WalletError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Override to handle async task setup configuration.
Called before the first call to
trigger.Auto Trait Implementations§
impl !Freeze for TaskReorg
impl !RefUnwindSafe for TaskReorg
impl Send for TaskReorg
impl Sync for TaskReorg
impl Unpin for TaskReorg
impl UnsafeUnpin for TaskReorg
impl !UnwindSafe for TaskReorg
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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