mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-26 07:37:57 +00:00
Avoid a duplicate block request when syncing from a fork (#11094)
* Separate queueing blocks for import from removal * Add regression tests * Remove unnecessary log * Clear queued blocks when processed * Move check out of match block * Track queued block ranges * Update client/network/sync/src/blocks.rs * Update client/network/sync/src/blocks.rs * Update client/network/sync/src/blocks.rs * Update client/network/sync/src/blocks.rs * FMT Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com> Co-authored-by: Bastian Köcher <info@kchr.de>
This commit is contained in:
@@ -160,6 +160,16 @@ pub enum BlockImportStatus<N: std::fmt::Debug + PartialEq> {
|
||||
ImportedUnknown(N, ImportedAux, Option<Origin>),
|
||||
}
|
||||
|
||||
impl<N: std::fmt::Debug + PartialEq> BlockImportStatus<N> {
|
||||
/// Returns the imported block number.
|
||||
pub fn number(&self) -> &N {
|
||||
match self {
|
||||
BlockImportStatus::ImportedKnown(n, _) |
|
||||
BlockImportStatus::ImportedUnknown(n, _, _) => n,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Block import error.
|
||||
#[derive(Debug, thiserror::Error)]
|
||||
pub enum BlockImportError {
|
||||
|
||||
Reference in New Issue
Block a user