pub fn destroy<S: Storage<Block, T>, Tx: StorageTransaction<Block, T>>(
		&self,
		storage: &S,
		tx: &mut Tx,
		best_finalized_block: Option<NumberFor<Block>>,
	) -> ClientResult<()> {
		let mut current = self.head.valid_from.clone();
		loop {
			// optionally: deletion stops when we found entry at finalized block
			if let Some(best_finalized_block) = best_finalized_block {
				if chain::is_finalized_block(storage, &current, best_finalized_block)? {
					return Ok(());
				}
			}

			// read pointer to previous entry
			let entry = storage.require_entry(&current)?;
			tx.remove_storage_entry(&current);

			// deletion stops when there are no more entries in the list
			current = match entry.prev_valid_from {
				Some(prev_valid_from) => prev_valid_from,
				None => return Ok(()),
			};
		}
	}
/// Destroy fork by deleting all unfinalized entries.
Destroy fork by deleting all unfinalized entries.
Destroy fork by deleting all unfinalized entries .
pub fn destroy<S: Storage<Block, T>, Tx: StorageTransaction<Block, T>>(
		&self,
		storage: &S,
		tx: &mut Tx,
		best_finalized_block: Option<NumberFor<Block>>,
	) -> ClientResult<()> {
		let mut current = self.head.valid_from.clone();
		loop {
			// optionally: deletion stops when we found entry at finalized block
			if let Some(best_finalized_block) = best_finalized_block {
				if chain::is_finalized_block(storage, &current, best_finalized_block)? {
					return Ok(());
				}
			}
			// read pointer to previous entry
			let entry = storage.require_entry(&current)?;
			tx.remove_storage_entry(&current);
			// deletion stops when there are no more entries in the list
			current = match entry.prev_valid_from {
				Some(prev_valid_from) => prev_valid_from,
				None => return Ok(()),
			};
		}
	}
pub fn destroy < S : Storage < Block , T > , Tx : StorageTransaction < Block , T > > ( & self , storage : & S , tx : & mut Tx , best_finalized_block : Option < NumberFor < Block > > , ) -> ClientResult < ( ) > { let mut current = self . head . valid_from . clone ( ) ; loop { // optionally: deletion stops when we found entry at finalized block if let Some ( best_finalized_block ) = best_finalized_block { if chain :: is_finalized_block ( storage , & current , best_finalized_block ) ? { return Ok ( ( ) ) ; } } // read pointer to previous entry let entry = storage . require_entry ( & current ) ? ; tx . remove_storage_entry ( & current ) ; // deletion stops when there are no more entries in the list current = match entry . prev_valid_from { Some ( prev_valid_from ) => prev_valid_from , None => return Ok ( ( ) ) , } ; } }
Destroy fork by deleting all unfinalized entries.
Destroy fork by deleting all unfinalized entries .
&self
storage
&S
tx
&mut Tx
best_finalized_block
Option<NumberFor<Block>>
&self
storage
&S
tx
&mut Tx
best_finalized_block
Option<NumberFor<Block>>