From 621ed513cbe67c1af4023f0fac6f781680e564b7 Mon Sep 17 00:00:00 2001 From: Enzo Cioppettini Date: Wed, 2 Jun 2021 15:32:09 -0300 Subject: [PATCH] update to recent Error changes --- jormungandr/src/blockchain/process.rs | 8 ++++++-- jormungandr/src/notifier/mod.rs | 4 +--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/jormungandr/src/blockchain/process.rs b/jormungandr/src/blockchain/process.rs index 4f32570c30..1608861fd9 100644 --- a/jormungandr/src/blockchain/process.rs +++ b/jormungandr/src/blockchain/process.rs @@ -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?; diff --git a/jormungandr/src/notifier/mod.rs b/jormungandr/src/notifier/mod.rs index ef1c8f1a17..a15f48eda9 100644 --- a/jormungandr/src/notifier/mod.rs +++ b/jormungandr/src/notifier/mod.rs @@ -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 {