Struct fuel_core_txpool::txpool::TxPool
source · pub struct TxPool<DB> { /* private fields */ }
Implementations§
source§impl<DB> TxPool<DB>where
DB: TxPoolDb,
impl<DB> TxPool<DB>where DB: TxPoolDb,
pub fn new(config: Config, database: DB) -> 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.
sourcepub fn insert(
&mut self,
tx_status_sender: &TxStatusChange,
txs: &[Arc<Transaction>]
) -> Vec<Result<InsertionResult>>
pub fn insert( &mut self, tx_status_sender: &TxStatusChange, txs: &[Arc<Transaction>] ) -> Vec<Result<InsertionResult>>
Import a set of transactions from network gossip or GraphQL endpoints.
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_sender: &TxStatusChange,
transactions: &[TxId]
)
pub fn block_update( &mut self, tx_status_sender: &TxStatusChange, transactions: &[TxId] )
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: &[TxId]
) -> Vec<ArcPoolTx>
pub fn remove( &mut self, tx_status_sender: &TxStatusChange, tx_ids: &[TxId] ) -> 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.
Trait Implementations§
Auto Trait Implementations§
impl<DB> RefUnwindSafe for TxPool<DB>where DB: RefUnwindSafe,
impl<DB> Send for TxPool<DB>where DB: Send,
impl<DB> Sync for TxPool<DB>where DB: Sync,
impl<DB> Unpin for TxPool<DB>where DB: Unpin,
impl<DB> UnwindSafe for TxPool<DB>where DB: UnwindSafe,
Blanket Implementations§
§impl<T> AnyDebug for Twhere
T: Any + Debug,
impl<T> AnyDebug for Twhere T: Any + Debug,
§fn as_any_ref(&self) -> &(dyn Any + 'static)
fn as_any_ref(&self) -> &(dyn Any + 'static)
Any
.