Skip to content

Commit 8a77665

Browse files
Revert "Check for parent of first ready block being on chain (#1812)"
This reverts commit 2b4b33d.
1 parent f4c4c0f commit 8a77665

File tree

2 files changed

+1
-421
lines changed

2 files changed

+1
-421
lines changed

substrate/client/network/sync/src/blocks.rs

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -212,31 +212,6 @@ impl<B: BlockT> BlockCollection<B> {
212212
ready
213213
}
214214

215-
/// Returns the block header of the first block that is ready for importing.
216-
/// `from` is the maximum block number for the start of the range that we are interested in.
217-
/// The function will return None if the first block ready is higher than `from`.
218-
/// The logic is structured to be consistent with ready_blocks().
219-
pub fn first_ready_block_header(&self, from: NumberFor<B>) -> Option<B::Header> {
220-
let mut prev = from;
221-
for (&start, range_data) in &self.blocks {
222-
if start > prev {
223-
break
224-
}
225-
226-
match range_data {
227-
BlockRangeState::Complete(blocks) => {
228-
let len = (blocks.len() as u32).into();
229-
prev = start + len;
230-
if let Some(BlockData { block, .. }) = blocks.first() {
231-
return block.header.clone()
232-
}
233-
},
234-
_ => continue,
235-
}
236-
}
237-
None
238-
}
239-
240215
pub fn clear_queued(&mut self, hash: &B::Hash) {
241216
if let Some((from, to)) = self.queued_blocks.remove(hash) {
242217
let mut block_num = from;

0 commit comments

Comments
 (0)