fn traverse_new_on_check(cell: &Cell, known_cells: &HashSet<UInt256>, visited: &mut HashSet<UInt256>, merkle_depth: u8) -> Result<()> {
        if visited.insert(cell.repr_hash()) {
            if cell.cell_type() == CellType::PrunedBranch {
                if cell.level() == merkle_depth + 1 &&
                    !known_cells.contains(&cell.hash(merkle_depth as usize)) {
                    fail!("old and new trees mismatch {:x}", cell.hash(merkle_depth as usize))
                }
            } else {
                let child_merkle_depth = if cell.is_merkle() { merkle_depth + 1 } else { merkle_depth };
                for child in cell.clone_references().iter() {
                    Self::traverse_new_on_check(child, known_cells, visited, child_merkle_depth)?;
                }
            }
        }
        Ok(())
    }
// Checks all pruned branches from new tree are exist in old tree
Checks all pruned branches from new tree are exist in old tree
Checks all pruned branches from new tree are exist in old tree
fn traverse_new_on_check(cell: &Cell, known_cells: &HashSet<UInt256>, visited: &mut HashSet<UInt256>, merkle_depth: u8) -> Result<()> {
        if visited.insert(cell.repr_hash()) {
            if cell.cell_type() == CellType::PrunedBranch {
                if cell.level() == merkle_depth + 1 &&
                    !known_cells.contains(&cell.hash(merkle_depth as usize)) {
                    fail!("old and new trees mismatch {:x}", cell.hash(merkle_depth as usize))
                }
            } else {
                let child_merkle_depth = if cell.is_merkle() { merkle_depth + 1 } else { merkle_depth };
                for child in cell.clone_references().iter() {
                    Self::traverse_new_on_check(child, known_cells, visited, child_merkle_depth)?;
                }
            }
        }
        Ok(())
    }
fn traverse_new_on_check ( cell : & Cell , known_cells : & HashSet < UInt256 > , visited : & mut HashSet < UInt256 > , merkle_depth : u8 ) -> Result < ( ) > { if visited . insert ( cell . repr_hash ( ) ) { if cell . cell_type ( ) == CellType :: PrunedBranch { if cell . level ( ) == merkle_depth + 1 && ! known_cells . contains ( & cell . hash ( merkle_depth as usize ) ) { fail ! ( " " cell hash ( merkle_depth as usize ) ) } } else { let child_merkle_depth = if cell . is_merkle ( ) { merkle_depth + 1 } else { merkle_depth } ; for child in cell . clone_references ( ) . iter ( ) { Self :: traverse_new_on_check ( child , known_cells , visited , child_merkle_depth ) ? ; } } } Ok ( ( ) ) }
Checks all pruned branches from new tree are exist in old tree
Checks all pruned branches from new tree are exist in old tree
cell
&Cell
known_cells
&HashSet<UInt256>
visited
&mut HashSet<UInt256>
merkle_depth
u8
cell
&Cell
known_cells
&HashSet<UInt256>
visited
&mut HashSet<UInt256>
merkle_depth
u8