(&self, blocks: Vec<Block>)
| 205 | } |
| 206 | |
| 207 | pub fn notify_new_blocks(&self, blocks: Vec<Block>) { |
| 208 | if let Some(bs) = self.bitswap.as_ref() { |
| 209 | let client = bs.client().clone(); |
| 210 | let handle = tokio::runtime::Handle::current(); |
| 211 | tokio::task::block_in_place(move || { |
| 212 | if let Err(err) = handle.block_on(client.notify_new_blocks(&blocks)) { |
| 213 | warn!("failed to notify bitswap about blocks: {:?}", err); |
| 214 | } |
| 215 | }); |
| 216 | } |
| 217 | } |
| 218 | |
| 219 | pub fn kad_bootstrap(&mut self) -> Result<()> { |
| 220 | if let Some(kad) = self.kad.as_mut() { |
no test coverage detected