fn remove_with_depend_myself(&mut self, hash: &U256, deleted: &mut Vec<Unconfirmed>) {
        // find position
        let delete_index = match self.txs.position(hash) {
            Some(index) => index,
            None => return,
        };

        // delete tx
        deleted.push(self.txs.remove(delete_index));

        // check depend_hashs
        loop {
            let mut delete_hash = None;

            while let Some(tx) = self.txs.streaming().next() {
                if tx.depend_hashs.contains(hash) {
                    delete_hash = Some(tx.hash.clone());
                    break;
                }
            }
            match delete_hash {
                Some(hash) => self.remove_with_depend_myself(&hash, deleted),
                None => break,
            }
        }
    }
/// remove unconfirmed tx with depend it
remove unconfirmed tx with depend it
remove unconfirmed tx with depend it
fn remove_with_depend_myself(&mut self, hash: &U256, deleted: &mut Vec<Unconfirmed>) {
        // find position
        let delete_index = match self.txs.position(hash) {
            Some(index) => index,
            None => return,
        };
        // delete tx
        deleted.push(self.txs.remove(delete_index));
        // check depend_hashs
        loop {
            let mut delete_hash = None;
            while let Some(tx) = self.txs.streaming().next() {
                if tx.depend_hashs.contains(hash) {
                    delete_hash = Some(tx.hash.clone());
                    break;
                }
            }
            match delete_hash {
                Some(hash) => self.remove_with_depend_myself(&hash, deleted),
                None => break,
            }
        }
    }
fn remove_with_depend_myself ( & mut self , hash : & U256 , deleted : & mut Vec < Unconfirmed > ) { // find position let delete_index = match self . txs . position ( hash ) { Some ( index ) => index , None => return , } ; // delete tx deleted . push ( self . txs . remove ( delete_index ) ) ; // check depend_hashs loop { let mut delete_hash = None ; while let Some ( tx ) = self . txs . streaming ( ) . next ( ) { if tx . depend_hashs . contains ( hash ) { delete_hash = Some ( tx . hash . clone ( ) ) ; break ; } } match delete_hash { Some ( hash ) => self . remove_with_depend_myself ( & hash , deleted ) , None => break , } } }
remove unconfirmed tx with depend it
remove unconfirmed tx with depend it
&mut self
hash
&U256
deleted
&mut Vec<Unconfirmed>
&mut self
hash
&U256
deleted
&mut Vec<Unconfirmed>