Skip to content

Commit

Permalink
Merge of #5537
Browse files Browse the repository at this point in the history
  • Loading branch information
mergify[bot] authored Nov 3, 2022
2 parents 71f5e63 + c31f086 commit e4f0d86
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
7 changes: 5 additions & 2 deletions zebra-state/src/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -609,14 +609,17 @@ impl StateService {
.contains(&prepared.hash)
{
let (rsp_tx, rsp_rx) = oneshot::channel();
let _ = rsp_tx.send(Err("block already sent to be committed to the state".into()));
let _ = rsp_tx.send(Err(
"block has already been sent to be committed to the state".into(),
));
return rsp_rx;
}

if self.read_service.db.contains_height(prepared.height) {
let (rsp_tx, rsp_rx) = oneshot::channel();
let _ = rsp_tx.send(Err(
"block height is already committed to the finalized state".into(),
"block height is in the finalized state: block is already committed to the state"
.into(),
));
return rsp_rx;
}
Expand Down
8 changes: 6 additions & 2 deletions zebrad/src/components/sync.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1120,9 +1120,12 @@ where
BlockDownloadVerifyError::Invalid {
error: VerifyChainError::Block(VerifyBlockError::Commit(ref source)),
..
} if format!("{source:?}").contains("block is already committed to the state") => {
} if format!("{source:?}").contains("block is already committed to the state")
|| format!("{source:?}")
.contains("block has already been sent to be committed to the state") =>
{
// TODO: improve this by checking the type (#2908)
debug!(error = ?e, "block is already committed, possibly from a previous sync run, continuing");
debug!(error = ?e, "block is already committed or pending a commit, possibly from a previous sync run, continuing");
false
}
BlockDownloadVerifyError::DownloadFailed { ref error, .. }
Expand Down Expand Up @@ -1152,6 +1155,7 @@ where
if err_str.contains("AlreadyVerified")
|| err_str.contains("AlreadyInChain")
|| err_str.contains("block is already committed to the state")
|| err_str.contains("block has already been sent to be committed to the state")
|| err_str.contains("NotFound")
{
error!(?e,
Expand Down

0 comments on commit e4f0d86

Please sign in to comment.