Fast/warp sync fixes (#10562)

* Fast sync fixes

* Fix gap blocks validation

* Updated test

* Formatting

* Networking test
This commit is contained in:
Arkadiy Paronyan
2022-01-13 16:26:06 +01:00
committed by GitHub
parent 3a88215fca
commit 4d477ea9b4
7 changed files with 126 additions and 32 deletions
+3
View File
@@ -130,6 +130,8 @@ pub enum Error<E: fmt::Debug> {
InvalidPruningMode(String),
/// Too many unfinalized sibling blocks inserted.
TooManySiblingBlocks,
/// Trying to insert existing block.
BlockAlreadyExists,
}
/// Pinning error type.
@@ -154,6 +156,7 @@ impl<E: fmt::Debug> fmt::Debug for Error<E> {
Error::InvalidParent => write!(f, "Trying to insert block with unknown parent"),
Error::InvalidPruningMode(e) => write!(f, "Expected pruning mode: {}", e),
Error::TooManySiblingBlocks => write!(f, "Too many sibling blocks inserted"),
Error::BlockAlreadyExists => write!(f, "Block already exists"),
}
}
}