Skip to content
Snippets Groups Projects
Commit b602946c authored by Éloïs's avatar Éloïs
Browse files

[fix] bc: if stackable block is invalid, write tx must return err

parent af20ab6d
Branches
Tags v0.20.1a8
1 merge request!235Elois/engine
...@@ -82,17 +82,27 @@ pub fn apply_stackable_blocks(bc: &mut BlockchainModule) { ...@@ -82,17 +82,27 @@ pub fn apply_stackable_blocks(bc: &mut BlockchainModule) {
bc, bc,
&BlockchainEvent::StackUpValidBlock(Box::new(new_current_block)), &BlockchainEvent::StackUpValidBlock(Box::new(new_current_block)),
); );
Ok(w)
} }
Ok(re) => warn!( Ok(re) => {
warn!(
"fail to stackable_block({}) : {:?}", "fail to stackable_block({}) : {:?}",
stackable_block_number, re stackable_block_number, re
), );
Err(e) => warn!( Err(DbError::WriteAbort {
reason: format!("{:?}", re),
})
}
Err(e) => {
warn!(
"fail to stackable_block({}) : {:?}", "fail to stackable_block({}) : {:?}",
stackable_block_number, e stackable_block_number, e
), );
Err(DbError::WriteAbort {
reason: format!("{:?}", e),
})
}
} }
Ok(w)
}); });
bc.db = Some(db); bc.db = Some(db);
match db_write_result { match db_write_result {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment