async fn tip_block_change(&mut self) -> Result<ChainTipBlock, watch::error::RecvError> {
        loop {
            // If there are multiple changes while this code is executing,
            // we don't rely on getting the first block or the latest block
            // after the change notification.
            // Any block update after the change will do,
            // we'll catch up with the tip after the next change.
            self.receiver.changed().await?;

            // Wait until there is actually Some block,
            // so we don't have `Option`s inside `TipAction`s.
            if let Some(block) = self.best_tip_block() {
                // Wait until we have a new block
                //
                // last_tip_change() updates last_change_hash, but it doesn't call receiver.changed().
                // So code that uses both sync and async methods can have spurious pending changes.
                //
                // TODO: use `receiver.borrow_and_update()` in `best_tip_block()`,
                //       once we upgrade to tokio 1.0 (#2200)
                //       and remove this extra check
                if Some(block.hash) != self.last_change_hash {
                    return Ok(block);
                }
            }
        }
    }
/// Wait until the next chain tip change, then return the corresponding [`ChainTipBlock`].
///
/// Returns an error if communication with the state is lost.
Wait until the next chain tip change, then return the corresponding [`ChainTipBlock`].
Returns an error if communication with the state is lost.
Wait until the next chain tip change then return the corresponding [ ` ChainTipBlock ` ] . Returns an error if communication with the state is lost .
async fn tip_block_change(&mut self) -> Result<ChainTipBlock, watch::error::RecvError> {
        loop {
            // If there are multiple changes while this code is executing,
            // we don't rely on getting the first block or the latest block
            // after the change notification.
            // Any block update after the change will do,
            // we'll catch up with the tip after the next change.
            self.receiver.changed().await?;
            // Wait until there is actually Some block,
            // so we don't have `Option`s inside `TipAction`s.
            if let Some(block) = self.best_tip_block() {
                // Wait until we have a new block
                //
                // last_tip_change() updates last_change_hash, but it doesn't call receiver.changed().
                // So code that uses both sync and async methods can have spurious pending changes.
                //
                // TODO: use `receiver.borrow_and_update()` in `best_tip_block()`,
                //       once we upgrade to tokio 1.0 (#2200)
                //       and remove this extra check
                if Some(block.hash) != self.last_change_hash {
                    return Ok(block);
                }
            }
        }
    }
async fn tip_block_change ( & mut self ) -> Result < ChainTipBlock , watch :: error :: RecvError > { loop { // If there are multiple changes while this code is executing, // we don't rely on getting the first block or the latest block // after the change notification. // Any block update after the change will do, // we'll catch up with the tip after the next change. self . receiver . changed ( ) . await ? ; // Wait until there is actually Some block, // so we don't have `Option`s inside `TipAction`s. if let Some ( block ) = self . best_tip_block ( ) { // Wait until we have a new block // // last_tip_change() updates last_change_hash, but it doesn't call receiver.changed(). // So code that uses both sync and async methods can have spurious pending changes. // // TODO: use `receiver.borrow_and_update()` in `best_tip_block()`, //       once we upgrade to tokio 1.0 (#2200) //       and remove this extra check if Some ( block . hash ) != self . last_change_hash { return Ok ( block ) ; } } } }
Wait until the next chain tip change, then return the corresponding [`ChainTipBlock`].
Wait until the next chain tip change then return the corresponding [ ` ChainTipBlock ` ] .
&mut self