@@ -799,7 +799,10 @@ where
799799
800800 // If block is from past epochs, try to update store's justified & finalized checkpoints right away
801801 if block. slot ( ) . epoch ( E :: slots_per_epoch ( ) ) < current_slot. epoch ( E :: slots_per_epoch ( ) ) {
802- self . pull_up_store_checkpoints ( ) ?;
802+ self . pull_up_store_checkpoints (
803+ unrealized_justified_checkpoint,
804+ unrealized_finalized_checkpoint,
805+ ) ?;
803806 }
804807
805808 (
@@ -1159,15 +1162,21 @@ where
11591162
11601163 // Update the justified/finalized checkpoints based upon the
11611164 // best-observed unrealized justification/finality.
1162- self . pull_up_store_checkpoints ( ) ?;
1165+ let unrealized_justified_checkpoint = * self . fc_store . unrealized_justified_checkpoint ( ) ;
1166+ let unrealized_finalized_checkpoint = * self . fc_store . unrealized_finalized_checkpoint ( ) ;
1167+ self . pull_up_store_checkpoints (
1168+ unrealized_justified_checkpoint,
1169+ unrealized_finalized_checkpoint,
1170+ ) ?;
11631171
11641172 Ok ( ( ) )
11651173 }
11661174
1167- fn pull_up_store_checkpoints ( & mut self ) -> Result < ( ) , Error < T :: Error > > {
1168- // Update store.justified_checkpoint if a better unrealized justified checkpoint is known
1169- let unrealized_justified_checkpoint = * self . fc_store . unrealized_justified_checkpoint ( ) ;
1170- let unrealized_finalized_checkpoint = * self . fc_store . unrealized_finalized_checkpoint ( ) ;
1175+ fn pull_up_store_checkpoints (
1176+ & mut self ,
1177+ unrealized_justified_checkpoint : Checkpoint ,
1178+ unrealized_finalized_checkpoint : Checkpoint ,
1179+ ) -> Result < ( ) , Error < T :: Error > > {
11711180 self . update_checkpoints (
11721181 unrealized_justified_checkpoint,
11731182 unrealized_finalized_checkpoint,
0 commit comments