@@ -537,6 +537,7 @@ async fn background_task<TPlat: PlatformRef>(
537537 & config. log_target,
538538 "reset" ,
539539 new_finalized = HashDisplay ( & initial_finalized_block_hash) ,
540+ subscription_id = ?subscribe_all. new_blocks. id( ) ,
540541 dropped_transactions
541542 ) ;
542543
@@ -751,10 +752,6 @@ async fn background_task<TPlat: PlatformRef>(
751752
752753 // Remove finalized blocks from the pool when possible.
753754 for block in worker. pending_transactions . prune_finalized_with_body ( ) {
754- // All blocks in `pending_transactions` are pinned within the runtime service.
755- // Unpin them when they're removed.
756- subscribe_all. new_blocks . unpin_block ( block. block_hash ) . await ;
757-
758755 log ! (
759756 & worker. platform,
760757 Debug ,
@@ -768,6 +765,10 @@ async fn background_task<TPlat: PlatformRef>(
768765 . join( ", " )
769766 ) ;
770767
768+ // All blocks in `pending_transactions` are pinned within the runtime service.
769+ // Unpin them when they're removed.
770+ subscribe_all. new_blocks . unpin_block ( block. block_hash ) . await ;
771+
771772 debug_assert ! ( !block. user_data. downloading) ;
772773 for mut tx in block. included_transactions {
773774 // We assume that there's no more than 2<<32 transactions per block.
@@ -853,6 +854,14 @@ async fn background_task<TPlat: PlatformRef>(
853854 worker. set_best_block ( & config. log_target , & best_block_hash_if_changed) ;
854855 }
855856 for pruned in worker. pending_transactions . set_finalized_block ( & hash) {
857+ log ! (
858+ & worker. platform,
859+ Debug ,
860+ & config. log_target,
861+ "pruned-block-discard" ,
862+ block = HashDisplay ( & pruned. 0 ) ,
863+ ) ;
864+
856865 // All blocks in `pending_transactions` are pinned within the
857866 // runtime service. Unpin them when they're removed.
858867 subscribe_all. new_blocks . unpin_block ( pruned. 0 ) . await ;
0 commit comments