MCPcopy Create free account
hub / github.com/ChainSafe/Delorean-Protocol / start_tx_cache_clearing

Function start_tx_cache_clearing

fendermint/eth/api/src/mpool.rs:82–91  ·  view source on GitHub ↗

Subscribe to `NewBlock` notifications and clear transactions from the caches.`

(
    client: FendermintClient<HybridClient>,
    tx_cache: TransactionCache,
    tx_buffer: TransactionBuffer,
)

Source from the content-addressed store, hash-verified

80
81/// Subscribe to `NewBlock` notifications and clear transactions from the caches.`
82pub fn start_tx_cache_clearing(
83 client: FendermintClient<HybridClient>,
84 tx_cache: TransactionCache,
85 tx_buffer: TransactionBuffer,
86) {
87 tokio::task::spawn(async move {
88 let chain_id = get_chain_id(&client).await;
89 tx_cache_clearing_loop(client.into_underlying(), chain_id, tx_cache, tx_buffer).await;
90 });
91}
92
93/// Subscribe to notifications about new blocks and
94/// 1) remove all included transactions from the caches

Callers 1

listenFunction · 0.85

Calls 3

get_chain_idFunction · 0.85
tx_cache_clearing_loopFunction · 0.85
into_underlyingMethod · 0.80

Tested by

no test coverage detected