Struct fuel_core_txpool::txpool::TxPool
source · pub struct TxPool<ViewProvider> { /* private fields */ }
Implementations§
source§impl<ViewProvider> TxPool<ViewProvider>
impl<ViewProvider> TxPool<ViewProvider>
pub fn new(config: Config, database: ViewProvider) -> Self
pub fn txs(&self) -> &HashMap<TxId, TxInfo>
pub fn dependency(&self) -> &Dependency
sourcepub fn sorted_includable(&self) -> impl Iterator<Item = ArcPoolTx> + '_
pub fn sorted_includable(&self) -> impl Iterator<Item = ArcPoolTx> + '_
Return all sorted transactions that are includable in next block.
pub fn remove_inner(&mut self, tx: &ArcPoolTx) -> Vec<ArcPoolTx>
sourcepub fn remove_by_tx_id(&mut self, tx_id: &TxId) -> Vec<ArcPoolTx>
pub fn remove_by_tx_id(&mut self, tx_id: &TxId) -> Vec<ArcPoolTx>
remove transaction from pool needed on user demand. Low priority
sourcepub fn remove_committed_tx(&mut self, tx_id: &TxId) -> Vec<ArcPoolTx>
pub fn remove_committed_tx(&mut self, tx_id: &TxId) -> Vec<ArcPoolTx>
Removes transaction from TxPool
with assumption that it is committed into the blockchain.
pub fn find_one(&self, hash: &TxId) -> Option<TxInfo>
sourcepub fn find_dependent(&self, hashes: &[TxId]) -> Vec<ArcPoolTx>
pub fn find_dependent(&self, hashes: &[TxId]) -> Vec<ArcPoolTx>
find all dependent tx and return them with requested dependencies in one list sorted by Price.
sourcepub fn pending_number(&self) -> usize
pub fn pending_number(&self) -> usize
The number of pending transaction in the pool.
sourcepub fn consumable_gas(&self) -> u64
pub fn consumable_gas(&self) -> u64
The amount of gas in all includable transactions combined
sourcepub fn includable(&mut self) -> impl Iterator<Item = ArcPoolTx> + '_
pub fn includable(&mut self) -> impl Iterator<Item = ArcPoolTx> + '_
Return all sorted transactions that are includable in next block. This is going to be heavy operation, use it only when needed.
sourcepub fn block_update(&mut self, tx_status: &[TransactionExecutionStatus])
pub fn block_update(&mut self, tx_status: &[TransactionExecutionStatus])
When block is updated we need to receive all spend outputs and remove them from txpool.
sourcepub fn remove(
&mut self,
tx_status_sender: &TxStatusChange,
tx_ids: Vec<(TxId, String)>,
) -> Vec<ArcPoolTx>
pub fn remove( &mut self, tx_status_sender: &TxStatusChange, tx_ids: Vec<(TxId, String)>, ) -> Vec<ArcPoolTx>
remove transaction from pool needed on user demand. Low priority
sourcepub fn prune_old_txs(&mut self) -> Vec<ArcPoolTx>
pub fn prune_old_txs(&mut self) -> Vec<ArcPoolTx>
Remove all old transactions from the pool.
source§impl<ViewProvider, View> TxPool<ViewProvider>where
ViewProvider: AtomicView<View = View>,
View: TxPoolDb,
impl<ViewProvider, View> TxPool<ViewProvider>where
ViewProvider: AtomicView<View = View>,
View: TxPoolDb,
sourcepub fn insert(
&mut self,
tx_status_sender: &TxStatusChange,
txs: Vec<Checked<Transaction>>,
) -> Vec<Result<InsertionResult, Error>>
pub fn insert( &mut self, tx_status_sender: &TxStatusChange, txs: Vec<Checked<Transaction>>, ) -> Vec<Result<InsertionResult, Error>>
Import a set of transactions from network gossip or GraphQL endpoints.
Trait Implementations§
Auto Trait Implementations§
impl<ViewProvider> Freeze for TxPool<ViewProvider>where
ViewProvider: Freeze,
impl<ViewProvider> RefUnwindSafe for TxPool<ViewProvider>where
ViewProvider: RefUnwindSafe,
impl<ViewProvider> Send for TxPool<ViewProvider>where
ViewProvider: Send,
impl<ViewProvider> Sync for TxPool<ViewProvider>where
ViewProvider: Sync,
impl<ViewProvider> Unpin for TxPool<ViewProvider>where
ViewProvider: Unpin,
impl<ViewProvider> UnwindSafe for TxPool<ViewProvider>where
ViewProvider: UnwindSafe,
Blanket Implementations§
source§impl<T> AnyDebug for T
impl<T> AnyDebug for T
source§fn as_any_ref(&self) -> &(dyn Any + 'static)
fn as_any_ref(&self) -> &(dyn Any + 'static)
Any
.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
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>
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>
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