fn rollback(&mut self, height: Height) -> Result<Vec<BlockHeader>, Error> {
        let mut stale = Vec::new();

        for block in self.chain.tail.drain(height as usize..) {
            stale.push(block.header);

            self.headers.remove(&block.hash);
            self.orphans.insert(block.hash, block.header);
        }
        self.store.rollback(height)?;

        Ok(stale)
    }
/// Rollback active chain to the given height. Returns the list of rolled-back headers.
Rollback active chain to the given height. Returns the list of rolled-back headers.
Rollback active chain to the given height . Returns the list of rolled - back headers .
fn rollback(&mut self, height: Height) -> Result<Vec<BlockHeader>, Error> {
        let mut stale = Vec::new();
        for block in self.chain.tail.drain(height as usize..) {
            stale.push(block.header);
            self.headers.remove(&block.hash);
            self.orphans.insert(block.hash, block.header);
        }
        self.store.rollback(height)?;
        Ok(stale)
    }
fn rollback ( & mut self , height : Height ) -> Result < Vec < BlockHeader > , Error > { let mut stale = Vec :: new ( ) ; for block in self . chain . tail . drain ( height as usize .. ) { stale . push ( block . header ) ; self . headers . remove ( & block . hash ) ; self . orphans . insert ( block . hash , block . header ) ; } self . store . rollback ( height ) ? ; Ok ( stale ) }
Rollback active chain to the given height.
Rollback active chain to the given height .
&mut self
height
Height