fn destroy_abandoned_forks<Tx: StorageTransaction<Block, T>>(
		&self,
		tx: &mut Tx,
		block: &ComplexBlockId<Block>
	) -> BTreeSet<usize> {
		let mut destroyed = BTreeSet::new();
		for (index, fork) in self.unfinalized.iter().enumerate() {
			if fork.head.valid_from.number == block.number {
				destroyed.insert(index);
				if fork.head.valid_from.hash != block.hash {
					if let Err(error) = fork.destroy(&self.storage, tx, Some(block.number)) {
						warn!(target: "db", "Failed to destroy abandoned unfinalized cache fork: {}", error);
					}
				}
			}
		}

		destroyed
	}
/// Try to destroy abandoned forks (forked before best finalized block) when block is finalized.
Try to destroy abandoned forks (forked before best finalized block) when block is finalized.
Try to destroy abandoned forks ( forked before best finalized block ) when block is finalized .
fn destroy_abandoned_forks<Tx: StorageTransaction<Block, T>>(
		&self,
		tx: &mut Tx,
		block: &ComplexBlockId<Block>
	) -> BTreeSet<usize> {
		let mut destroyed = BTreeSet::new();
		for (index, fork) in self.unfinalized.iter().enumerate() {
			if fork.head.valid_from.number == block.number {
				destroyed.insert(index);
				if fork.head.valid_from.hash != block.hash {
					if let Err(error) = fork.destroy(&self.storage, tx, Some(block.number)) {
						warn!(target: "db", "Failed to destroy abandoned unfinalized cache fork: {}", error);
					}
				}
			}
		}
		destroyed
	}
fn destroy_abandoned_forks < Tx : StorageTransaction < Block , T > > ( & self , tx : & mut Tx , block : & ComplexBlockId < Block > ) -> BTreeSet < usize > { let mut destroyed = BTreeSet :: new ( ) ; for ( index , fork ) in self . unfinalized . iter ( ) . enumerate ( ) { if fork . head . valid_from . number == block . number { destroyed . insert ( index ) ; if fork . head . valid_from . hash != block . hash { if let Err ( error ) = fork . destroy ( & self . storage , tx , Some ( block . number ) ) { warn ! ( target " " " " error ) ; } } } } destroyed }
Try to destroy abandoned forks (forked before best finalized block) when block is finalized.
Try to destroy abandoned forks ( forked before best finalized block ) when block is finalized .
&self
tx
&mut Tx
block
&ComplexBlockId<Block>
&self
tx
&mut Tx
block
&ComplexBlockId<Block>