pub fn prune_tags(&mut self, tags: impl IntoIterator<Item=Tag>) -> PruneStatus<Hash, Ex> {
		let mut to_import = vec![];
		let mut pruned = vec![];
		let recently_pruned = &mut self.recently_pruned[self.recently_pruned_index];
		self.recently_pruned_index = (self.recently_pruned_index + 1) % RECENTLY_PRUNED_TAGS;
		recently_pruned.clear();

		for tag in tags {
			// make sure to promote any future transactions that could be unlocked
			to_import.append(&mut self.future.satisfy_tags(::std::iter::once(&tag)));
			// and actually prune transactions in ready queue
			pruned.append(&mut self.ready.prune_tags(tag.clone()));
			// store the tags for next submission
			recently_pruned.insert(tag);
		}

		let mut promoted = vec![];
		let mut failed = vec![];
		for tx in to_import {
			let hash = tx.transaction.hash.clone();
			match self.import_to_ready(tx) {
				Ok(res) => promoted.push(res),
				Err(e) => {
					warn!(target: "txpool", "[{:?}] Failed to promote during pruning: {:?}", hash, e);
					failed.push(hash)
				},
			}
		}

		PruneStatus {
			pruned,
			failed,
			promoted,
		}
	}
/// Prunes transactions that provide given list of tags.
///
/// This will cause all transactions that provide these tags to be removed from the pool,
/// but unlike `remove_invalid`, dependent transactions are not touched.
/// Additional transactions from future queue might be promoted to ready if you satisfy tags
/// that the pool didn't previously know about.
Prunes transactions that provide given list of tags.
This will cause all transactions that provide these tags to be removed from the pool,
but unlike `remove_invalid`, dependent transactions are not touched.
Additional transactions from future queue might be promoted to ready if you satisfy tags
that the pool didn't previously know about.
Prunes transactions that provide given list of tags . This will cause all transactions that provide these tags to be removed from the pool but unlike ` remove_invalid ` dependent transactions are not touched . Additional transactions from future queue might be promoted to ready if you satisfy tags that the pool didn ' t previously know about .
pub fn prune_tags(&mut self, tags: impl IntoIterator<Item=Tag>) -> PruneStatus<Hash, Ex> {
		let mut to_import = vec![];
		let mut pruned = vec![];
		let recently_pruned = &mut self.recently_pruned[self.recently_pruned_index];
		self.recently_pruned_index = (self.recently_pruned_index + 1) % RECENTLY_PRUNED_TAGS;
		recently_pruned.clear();
		for tag in tags {
			// make sure to promote any future transactions that could be unlocked
			to_import.append(&mut self.future.satisfy_tags(::std::iter::once(&tag)));
			// and actually prune transactions in ready queue
			pruned.append(&mut self.ready.prune_tags(tag.clone()));
			// store the tags for next submission
			recently_pruned.insert(tag);
		}
		let mut promoted = vec![];
		let mut failed = vec![];
		for tx in to_import {
			let hash = tx.transaction.hash.clone();
			match self.import_to_ready(tx) {
				Ok(res) => promoted.push(res),
				Err(e) => {
					warn!(target: "txpool", "[{:?}] Failed to promote during pruning: {:?}", hash, e);
					failed.push(hash)
				},
			}
		}
		PruneStatus {
			pruned,
			failed,
			promoted,
		}
	}
pub fn prune_tags ( & mut self , tags : impl IntoIterator < Item = Tag > ) -> PruneStatus < Hash , Ex > { let mut to_import = vec ! [ ] ; let mut pruned = vec ! [ ] ; let recently_pruned = & mut self . recently_pruned [ self . recently_pruned_index ] ; self . recently_pruned_index = ( self . recently_pruned_index + 1 ) % RECENTLY_PRUNED_TAGS ; recently_pruned . clear ( ) ; for tag in tags { // make sure to promote any future transactions that could be unlocked to_import . append ( & mut self . future . satisfy_tags ( :: std :: iter :: once ( & tag ) ) ) ; // and actually prune transactions in ready queue pruned . append ( & mut self . ready . prune_tags ( tag . clone ( ) ) ) ; // store the tags for next submission recently_pruned . insert ( tag ) ; } let mut promoted = vec ! [ ] ; let mut failed = vec ! [ ] ; for tx in to_import { let hash = tx . transaction . hash . clone ( ) ; match self . import_to_ready ( tx ) { Ok ( res ) => promoted . push ( res ) , Err ( e ) => { warn ! ( target " " " " hash e ) ; failed . push ( hash ) } , } } PruneStatus { pruned , failed , promoted , } }
Prunes transactions that provide given list of tags.
Prunes transactions that provide given list of tags .
&mut self
tags
impl IntoIterator<Item=Tag>
&mut self
tags
impl IntoIterator<Item=Tag>