convert try!() to ?

This commit is contained in:
Guanqun Lu
2017-06-18 22:15:44 +08:00
parent ed20fa4da1
commit 41fed96d96
5 changed files with 12 additions and 12 deletions

View File

@@ -255,13 +255,13 @@ impl Engine for Arc<Ethash> {
fn on_new_block(&self, block: &mut ExecutedBlock, last_hashes: Arc<LastHashes>) -> Result<(), Error> {
let parent_hash = block.fields().header.parent_hash().clone();
try!(::engines::common::push_last_hash(block, last_hashes, self, &parent_hash));
::engines::common::push_last_hash(block, last_hashes, self, &parent_hash)?;
if block.fields().header.number() == self.ethash_params.dao_hardfork_transition {
let state = block.fields_mut().state;
for child in &self.ethash_params.dao_hardfork_accounts {
let beneficiary = &self.ethash_params.dao_hardfork_beneficiary;
try!(state.balance(child)
.and_then(|b| state.transfer_balance(child, beneficiary, &b, CleanupMode::NoEmpty)));
state.balance(child)
.and_then(|b| state.transfer_balance(child, beneficiary, &b, CleanupMode::NoEmpty))?;
}
}
Ok(())