File tree Expand file tree Collapse file tree 2 files changed +4
-6
lines changed
Expand file tree Collapse file tree 2 files changed +4
-6
lines changed Original file line number Diff line number Diff line change @@ -97,7 +97,7 @@ impl SyncManager {
9797 }
9898
9999 /// Updates the last fcu head. This may be used on the next sync cycle if needed
100- fn set_head ( & self , fcu_head : H256 ) {
100+ pub fn set_head ( & self , fcu_head : H256 ) {
101101 if let Ok ( mut latest_fcu_head) = self . last_fcu_head . try_lock ( ) {
102102 * latest_fcu_head = fcu_head;
103103 } else {
@@ -106,7 +106,7 @@ impl SyncManager {
106106 }
107107
108108 /// Returns true is the syncer is active
109- fn is_active ( & self ) -> bool {
109+ pub fn is_active ( & self ) -> bool {
110110 self . syncer . try_lock ( ) . is_err ( )
111111 }
112112
Original file line number Diff line number Diff line change @@ -210,10 +210,8 @@ async fn handle_forkchoice(
210210 ) ) ;
211211 }
212212
213- if context. syncer . sync_mode ( ) == SyncMode :: Snap {
214- context
215- . syncer
216- . sync_to_head ( fork_choice_state. head_block_hash ) ;
213+ if context. syncer . sync_mode ( ) == SyncMode :: Snap && context. syncer . is_active ( ) {
214+ context. syncer . set_head ( fork_choice_state. head_block_hash ) ;
217215 return Ok ( ( None , PayloadStatus :: syncing ( ) . into ( ) ) ) ;
218216 }
219217
You can’t perform that action at this time.
0 commit comments