Skip to content

Commit

Permalink
fix: Add proper returns when parsing fails in miner
Browse files Browse the repository at this point in the history
  • Loading branch information
xxuejie committed Apr 10, 2019
1 parent 9925d4e commit f37cf2c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions miner/src/miner.rs
Expand Up @@ -74,24 +74,28 @@ impl Miner {
let uncles = uncles.into_iter().map(TryInto::try_into).collect();
if let Err(ref e) = uncles {
error!(target: "miner", "error parsing uncles: {:?}", e);
return None;
}
let cellbase = cellbase.try_into();
if let Err(ref e) = cellbase {
error!(target: "miner", "error parsing cellbase: {:?}", e);
return None;
}
let commit_transactions = commit_transactions
.into_iter()
.map(TryInto::try_into)
.collect();
if let Err(ref e) = commit_transactions {
error!(target: "miner", "error parsing commit transactions: {:?}", e);
return None;
}
let proposal_transactions = proposal_transactions
.into_iter()
.map(TryInto::try_into)
.collect();
if let Err(ref e) = proposal_transactions {
error!(target: "miner", "error parsing proposal transactions: {:?}", e);
return None;
}

let block = BlockBuilder::default()
Expand Down

0 comments on commit f37cf2c

Please sign in to comment.