Skip to content

Commit

Permalink
update to recent Error changes
Browse files Browse the repository at this point in the history
  • Loading branch information
ecioppettini committed Jun 8, 2021
1 parent cd284cd commit 621ed51
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
8 changes: 6 additions & 2 deletions jormungandr/src/blockchain/process.rs
Expand Up @@ -461,10 +461,14 @@ async fn process_leadership_block(
// Track block as new new tip block
stats_counter.set_tip_block(Arc::new(block.clone()));

notifier_msg_box
if notifier_msg_box
.send(NotifierMsg::NewBlock(block.clone()))
.await
.map_err(|_| "Cannot propagate block to blockchain event notifier")?;
.is_err()
{
// TODO: add an error type?
tracing::error!("Cannot propagate block to blockchain event notifier");
}

if let Some(mut msg_box) = explorer_msg_box {
msg_box.send(ExplorerMsg::NewBlock(block)).await?;
Expand Down
4 changes: 1 addition & 3 deletions jormungandr/src/notifier/mod.rs
Expand Up @@ -121,9 +121,7 @@ impl MessageProcessor {
mempool_event::Event::Inserted(MempoolFragmentInserted {})
}
FragmentStatus::Rejected { reason } => {
mempool_event::Event::Rejected(MempoolFragmentRejected {
reason: reason.clone(),
})
mempool_event::Event::Rejected(MempoolFragmentRejected { reason })
}
FragmentStatus::InABlock { block, .. } => {
mempool_event::Event::InABlock(MempoolFragmentInABlock {
Expand Down

0 comments on commit 621ed51

Please sign in to comment.