pub fn collect_garbage(&self) -> Result<(), failure::Error> {
        let mut txs_to_remove: Vec<_> = self.load_txs()?.into_iter().collect();
        txs_to_remove.retain(|tx| {
            let tx_hash = tx.hash();
            self.0
                .chain()
                .operations_ext_schema()
                .get_tx_by_hash(tx_hash.as_ref())
                .expect("DB issue while restoring the mempool state")
                .is_some()
        });

        let tx_hashes: Vec<_> = txs_to_remove.into_iter().map(|tx| tx.hash()).collect();

        self.remove_txs(&tx_hashes)?;

        Ok(())
    }
/// Removes transactions that are already committed.
/// Though it's unlikely that mempool schema will ever contain a committed
/// transaction, it's better to ensure that we won't process the same transaction
/// again. One possible scenario for having already-processed txs in the database
/// is a failure of `remove_txs` method, which won't cause a panic on server, but will
/// left txs in the database.
///
/// This method is expected to be initially invoked on the server start, and then
/// invoked periodically with a big interval (to prevent possible database bloating).
Removes transactions that are already committed.
Though it's unlikely that mempool schema will ever contain a committed
transaction, it's better to ensure that we won't process the same transaction
again. One possible scenario for having already-processed txs in the database
is a failure of `remove_txs` method, which won't cause a panic on server, but will
left txs in the database.

This method is expected to be initially invoked on the server start, and then
invoked periodically with a big interval (to prevent possible database bloating).
Removes transactions that are already committed . Though it ' s unlikely that mempool schema will ever contain a committed transaction it ' s better to ensure that we won ' t process the same transaction again . One possible scenario for having already - processed txs in the database is a failure of ` remove_txs ` method which won ' t cause a panic on server but will left txs in the database . This method is expected to be initially invoked on the server start and then invoked periodically with a big interval ( to prevent possible database bloating ) .
pub fn collect_garbage(&self) -> Result<(), failure::Error> {
        let mut txs_to_remove: Vec<_> = self.load_txs()?.into_iter().collect();
        txs_to_remove.retain(|tx| {
            let tx_hash = tx.hash();
            self.0
                .chain()
                .operations_ext_schema()
                .get_tx_by_hash(tx_hash.as_ref())
                .expect("DB issue while restoring the mempool state")
                .is_some()
        });
        let tx_hashes: Vec<_> = txs_to_remove.into_iter().map(|tx| tx.hash()).collect();
        self.remove_txs(&tx_hashes)?;
        Ok(())
    }
pub fn collect_garbage ( & self ) -> Result < ( ) , failure :: Error > { let mut txs_to_remove : Vec < _ > = self . load_txs ( ) ? . into_iter ( ) . collect ( ) ; txs_to_remove . retain ( | tx | { let tx_hash = tx . hash ( ) ; self . 0 . chain ( ) . operations_ext_schema ( ) . get_tx_by_hash ( tx_hash . as_ref ( ) ) . expect ( " " ) . is_some ( ) } ) ; let tx_hashes : Vec < _ > = txs_to_remove . into_iter ( ) . map ( | tx | tx . hash ( ) ) . collect ( ) ; self . remove_txs ( & tx_hashes ) ? ; Ok ( ( ) ) }
Removes transactions that are already committed.
Removes transactions that are already committed .
&self