File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed
cumulus/client/consensus/relay-chain/src Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -20,6 +20,7 @@ use std::{marker::PhantomData, sync::Arc};
2020use sc_consensus:: { import_queue:: Verifier as VerifierT , BlockImportParams } ;
2121use sp_api:: ProvideRuntimeApi ;
2222use sp_block_builder:: BlockBuilder as BlockBuilderApi ;
23+ use sp_consensus:: BlockOrigin ;
2324use sp_inherents:: CreateInherentDataProviders ;
2425use sp_runtime:: traits:: { Block as BlockT , Header as HeaderT } ;
2526
4950 & self ,
5051 mut block_params : BlockImportParams < Block > ,
5152 ) -> Result < BlockImportParams < Block > , String > {
52- block_params. fork_choice = Some ( sc_consensus:: ForkChoiceStrategy :: Custom (
53- block_params. origin == sp_consensus:: BlockOrigin :: NetworkInitialSync ,
54- ) ) ;
53+ let is_sync_selected = matches ! (
54+ block_params. origin,
55+ BlockOrigin :: NetworkInitialSync |
56+ BlockOrigin :: WarpSync |
57+ BlockOrigin :: StateSync { .. } |
58+ BlockOrigin :: GapSync
59+ ) ;
60+ block_params. fork_choice = Some ( sc_consensus:: ForkChoiceStrategy :: Custom ( is_sync_selected) ) ;
5561
5662 // Skip checks that include execution, if being told so, or when importing only state.
5763 //
You can’t perform that action at this time.
0 commit comments