@@ -1291,14 +1291,13 @@ impl<Block: BlockT> Backend<Block> {
12911291 header : & Block :: Header ,
12921292 last_finalized : Option < Block :: Hash > ,
12931293 justification : Option < Justification > ,
1294- finalization_displaced : & mut Option < FinalizationOutcome < Block :: Hash , NumberFor < Block > > > ,
12951294 ) -> ClientResult < MetaUpdate < Block > > {
12961295 // TODO: ensure best chain contains this block.
12971296 let number = * header. number ( ) ;
12981297 self . ensure_sequential_finalization ( header, last_finalized) ?;
12991298 let with_state = sc_client_api:: Backend :: have_state_at ( self , hash, number) ;
13001299
1301- self . note_finalized ( transaction, header, hash, finalization_displaced , with_state) ?;
1300+ self . note_finalized ( transaction, header, hash, with_state) ?;
13021301
13031302 if let Some ( justification) = justification {
13041303 transaction. set_from_vec (
@@ -1362,7 +1361,6 @@ impl<Block: BlockT> Backend<Block> {
13621361
13631362 fn try_commit_operation ( & self , mut operation : BlockImportOperation < Block > ) -> ClientResult < ( ) > {
13641363 let mut transaction = Transaction :: new ( ) ;
1365- let mut finalization_displaced_leaves = None ;
13661364
13671365 operation. apply_aux ( & mut transaction) ;
13681366 operation. apply_offchain ( & mut transaction) ;
@@ -1381,7 +1379,6 @@ impl<Block: BlockT> Backend<Block> {
13811379 & block_header,
13821380 Some ( last_finalized_hash) ,
13831381 justification,
1384- & mut finalization_displaced_leaves,
13851382 ) ?) ;
13861383 last_finalized_hash = block_hash;
13871384 last_finalized_num = * block_header. number ( ) ;
@@ -1554,13 +1551,7 @@ impl<Block: BlockT> Backend<Block> {
15541551 if finalized {
15551552 // TODO: ensure best chain contains this block.
15561553 self . ensure_sequential_finalization ( header, Some ( last_finalized_hash) ) ?;
1557- self . note_finalized (
1558- & mut transaction,
1559- header,
1560- hash,
1561- & mut finalization_displaced_leaves,
1562- operation. commit_state ,
1563- ) ?;
1554+ self . note_finalized ( & mut transaction, header, hash, operation. commit_state ) ?;
15641555 } else {
15651556 // canonicalize blocks which are old enough, regardless of finality.
15661557 self . force_delayed_canonicalize ( & mut transaction) ?
@@ -1692,7 +1683,6 @@ impl<Block: BlockT> Backend<Block> {
16921683 transaction : & mut Transaction < DbHash > ,
16931684 f_header : & Block :: Header ,
16941685 f_hash : Block :: Hash ,
1695- displaced : & mut Option < FinalizationOutcome < Block :: Hash , NumberFor < Block > > > ,
16961686 with_state : bool ,
16971687 ) -> ClientResult < ( ) > {
16981688 let f_num = * f_header. number ( ) ;
@@ -1720,10 +1710,6 @@ impl<Block: BlockT> Backend<Block> {
17201710
17211711 let new_displaced = self . blockchain . leaves . write ( ) . finalize_height ( f_num) ;
17221712 self . prune_blocks ( transaction, f_num, & new_displaced) ?;
1723- match displaced {
1724- x @ & mut None => * x = Some ( new_displaced) ,
1725- & mut Some ( ref mut displaced) => displaced. merge ( new_displaced) ,
1726- }
17271713
17281714 Ok ( ( ) )
17291715 }
@@ -2013,16 +1999,15 @@ impl<Block: BlockT> sc_client_api::backend::Backend<Block> for Backend<Block> {
20131999 ) -> ClientResult < ( ) > {
20142000 let mut transaction = Transaction :: new ( ) ;
20152001 let header = self . blockchain . expect_header ( hash) ?;
2016- let mut displaced = None ;
20172002
20182003 let m = self . finalize_block_with_transaction (
20192004 & mut transaction,
20202005 hash,
20212006 & header,
20222007 None ,
20232008 justification,
2024- & mut displaced,
20252009 ) ?;
2010+
20262011 self . storage . db . commit ( transaction) ?;
20272012 self . blockchain . update_meta ( m) ;
20282013 Ok ( ( ) )
0 commit comments