Skip to content

Commit

Permalink
Remove unused BlockStatus::Pending (openethereum#9447)
Browse files Browse the repository at this point in the history
Pending case never instantiated, and only ever matched together with Unknown
  • Loading branch information
ascjones authored Aug 31, 2018
1 parent 3dbea1a commit bc53e78
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 6 deletions.
4 changes: 2 additions & 2 deletions ethcore/src/client/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1391,7 +1391,7 @@ impl ImportBlock for Client {
bail!(BlockImportErrorKind::Import(ImportErrorKind::AlreadyInChain));
}
let status = self.block_status(BlockId::Hash(unverified.parent_hash()));
if status == BlockStatus::Unknown || status == BlockStatus::Pending {
if status == BlockStatus::Unknown {
bail!(BlockImportErrorKind::Block(BlockError::UnknownParent(unverified.parent_hash())));
}

Expand Down Expand Up @@ -2082,7 +2082,7 @@ impl IoClient for Client {
let is_parent_pending = self.queued_ancient_blocks.read().0.contains(&parent_hash);
if !is_parent_pending {
let status = self.block_status(BlockId::Hash(parent_hash));
if status == BlockStatus::Unknown || status == BlockStatus::Pending {
if status == BlockStatus::Unknown {
bail!(BlockImportErrorKind::Block(BlockError::UnknownParent(parent_hash)));
}
}
Expand Down
2 changes: 1 addition & 1 deletion ethcore/sync/src/block_sync.rs
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ impl BlockDownloader {
BlockStatus::Bad => {
return Err(BlockDownloaderImportError::Invalid);
},
BlockStatus::Unknown | BlockStatus::Pending => {
BlockStatus::Unknown => {
headers.push(info);
hashes.push(hash);
}
Expand Down
2 changes: 1 addition & 1 deletion ethcore/sync/src/chain/handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ impl SyncHandler {
BlockStatus::Queued => {
trace!(target: "sync", "New hash block already queued {:?}", hash);
},
BlockStatus::Unknown | BlockStatus::Pending => {
BlockStatus::Unknown => {
new_hashes.push(hash.clone());
if number > max_height {
trace!(target: "sync", "New unknown block hash {:?}", hash);
Expand Down
2 changes: 0 additions & 2 deletions ethcore/types/src/block_status.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ pub enum BlockStatus {
Queued,
/// Known as bad.
Bad,
/// Pending block.
Pending,
/// Unknown.
Unknown,
}

0 comments on commit bc53e78

Please sign in to comment.