@@ -33,10 +33,10 @@ pub(crate) const INDEXING_DB_READY_WAIT_INTERVAL: Duration = Duration::from_secs
3333
3434/// Start syncing a particular network
3535async fn start_sync_for ( cfg : & chain_follower:: EnvVars ) -> anyhow:: Result < ( ) > {
36- let chain = cfg. chain ;
36+ let chain = & cfg. chain ;
3737 let dl_config = cfg. dl_config . clone ( ) ;
3838
39- let mut cfg = ChainSyncConfig :: default_for ( chain) ;
39+ let mut cfg = ChainSyncConfig :: default_for ( chain. clone ( ) ) ;
4040 cfg. mithril_cfg = cfg. mithril_cfg . with_dl_config ( dl_config) ;
4141 info ! ( chain = %chain, "Starting Chain Sync Task" ) ;
4242
@@ -263,9 +263,9 @@ fn sync_subchain(
263263 let mut blocks_synced = 0u64 ;
264264
265265 let mut follower =
266- ChainFollower :: new ( params. chain , params. actual_start ( ) , params. end . clone ( ) ) . await ;
266+ ChainFollower :: new ( & params. chain , params. actual_start ( ) , params. end . clone ( ) ) . await ;
267267 while let Some ( chain_update) = follower. next ( ) . await {
268- let tips = ChainFollower :: get_tips ( params. chain ) . await ;
268+ let tips = ChainFollower :: get_tips ( & params. chain ) . await ;
269269 let immutable_slot = tips. 0 . slot_or_default ( ) ;
270270 let live_slot = tips. 1 . slot_or_default ( ) ;
271271 metrics_updater:: current_tip_slot ( live_slot, immutable_slot) ;
@@ -495,7 +495,7 @@ impl SyncTask {
495495 async fn run ( & mut self ) {
496496 // We can't sync until the local chain data is synced.
497497 // This call will wait until we sync.
498- let tips = ChainFollower :: get_tips ( self . cfg . chain ) . await ;
498+ let tips = ChainFollower :: get_tips ( & self . cfg . chain ) . await ;
499499 self . immutable_tip_slot = tips. 0 . slot_or_default ( ) ;
500500 self . live_tip_slot = tips. 1 . slot_or_default ( ) ;
501501 info ! ( chain=%self . cfg. chain, immutable_tip=?self . immutable_tip_slot, live_tip=?self . live_tip_slot, "Running the primary blockchain follower task." ) ;
@@ -516,7 +516,7 @@ impl SyncTask {
516516 // Start the Live Chain sync task - This can never end because it is syncing to TIP.
517517 // So, if it fails, it will automatically be restarted.
518518 self . add_sync_task ( SyncParams :: new (
519- self . cfg . chain ,
519+ self . cfg . chain . clone ( ) ,
520520 Point :: fuzzy ( self . immutable_tip_slot ) ,
521521 Point :: TIP ,
522522 ) ) ;
@@ -542,7 +542,7 @@ impl SyncTask {
542542
543543 match completed {
544544 Ok ( finished) => {
545- let tips = ChainFollower :: get_tips ( self . cfg . chain ) . await ;
545+ let tips = ChainFollower :: get_tips ( & self . cfg . chain ) . await ;
546546 let immutable_tip_slot = tips. 0 . slot_or_default ( ) ;
547547 let live_tip_slot = tips. 1 . slot_or_default ( ) ;
548548 info ! ( immutable_tip_slot=?immutable_tip_slot, live_tip_slot=?live_tip_slot, "Chain Indexer task finished" ) ;
@@ -672,7 +672,7 @@ impl SyncTask {
672672 self . get_syncable_range ( self . start_slot , end_slot)
673673 {
674674 self . add_sync_task ( SyncParams :: new (
675- self . cfg . chain ,
675+ self . cfg . chain . clone ( ) ,
676676 first_point,
677677 last_point. clone ( ) ,
678678 ) ) ;
0 commit comments