Skip to content

Commit

Permalink
code cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
SurfingNerd committed Mar 24, 2022
1 parent 6c4b3a5 commit 89f4f8e
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions crates/ethcore/src/engines/hbbft/hbbft_message_memorium.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ impl HbbftMessageDispatcher {
self.ensure_worker_thread();
}


pub fn on_message_received(&mut self , message: &HbMessage) {
//performance: dispatcher pattern + multithreading could improve performance a lot.

Expand Down Expand Up @@ -199,6 +198,8 @@ impl HbbftMessageMemorium {

fn work_message(&mut self ) -> bool {

// warn!(target: "consensus", "working on hbbft messages: {} consensuns: {}", self.dispatched_messages.len(), self.dispatched_seals.len());

let mut message_option
= self.dispatched_messages.pop_front();

Expand All @@ -222,10 +223,9 @@ impl HbbftMessageMemorium {
let mut seal_option = self.dispatched_seals.pop_front();

if let Some(seal) = seal_option {
let epoch = seal.1;
match serde_json::to_string(&seal.0) {
Ok(json_string) => {
self.on_message_string_received(json_string, epoch);
self.on_message_string_received(json_string, seal.1);
}
Err(e) => {
// being unable to interprete a message, could result in consequences
Expand All @@ -240,13 +240,10 @@ impl HbbftMessageMemorium {
return false;

// let content = message.content();

//match content {
// MessageContent::Subset(subset) => {}

// MessageContent::DecryptionShare { proposer_id, share } => {
// debug!("got decryption share from {} {:?}", proposer_id, share);

// if !self.decryption_shares.contains_key(&epoch) {
// match self.decryption_shares.insert(epoch, Vec::new()) {
// None => {}
Expand Down

0 comments on commit 89f4f8e

Please sign in to comment.