@@ -40,7 +40,8 @@ use indexer_config::{
4040 SubgraphConfig , SubgraphsConfig , TapConfig ,
4141} ;
4242use indexer_monitor:: {
43- escrow_accounts_v1, escrow_accounts_v2, indexer_allocations, DeploymentDetails , SubgraphClient ,
43+ empty_escrow_accounts_watcher, escrow_accounts_v1, escrow_accounts_v2, indexer_allocations,
44+ DeploymentDetails , SubgraphClient ,
4445} ;
4546use ractor:: { concurrency:: JoinHandle , Actor , ActorRef } ;
4647use sender_account:: SenderAccountConfig ;
@@ -165,16 +166,6 @@ pub async fn start_agent() -> (ActorRef<SenderAccountsManagerMessage>, JoinHandl
165166 . await
166167 . expect ( "Error creating escrow_accounts channel" ) ;
167168
168- // V2 escrow accounts are in the network subgraph, not a separate TAP v2 subgraph
169- let escrow_accounts_v2 = escrow_accounts_v2 (
170- network_subgraph,
171- * indexer_address,
172- * network_sync_interval,
173- false ,
174- )
175- . await
176- . expect ( "Error creating escrow_accounts_v2 channel" ) ;
177-
178169 // Determine if we should check for Horizon contracts and potentially enable hybrid mode:
179170 // - If horizon.enabled = false: Pure legacy mode, no Horizon detection
180171 // - If horizon.enabled = true: Check if Horizon contracts are active in the network
@@ -205,13 +196,29 @@ pub async fn start_agent() -> (ActorRef<SenderAccountsManagerMessage>, JoinHandl
205196 false
206197 } ;
207198
199+ // Create V2 escrow accounts watcher only if Horizon is active
200+ // V2 escrow accounts are in the network subgraph, not a separate TAP v2 subgraph
201+ let escrow_accounts_v2 = if is_horizon_enabled {
202+ escrow_accounts_v2 (
203+ network_subgraph,
204+ * indexer_address,
205+ * network_sync_interval,
206+ false ,
207+ )
208+ . await
209+ . expect ( "Error creating escrow_accounts_v2 channel" )
210+ } else {
211+ // Create a dummy watcher that never updates for consistency
212+ empty_escrow_accounts_watcher ( )
213+ } ;
214+
208215 // In both modes we need both watchers for the hybrid processing
209216 let ( escrow_accounts_v1_final, escrow_accounts_v2_final) = if is_horizon_enabled {
210217 tracing:: info!( "TAP Agent: Horizon migration mode - processing existing V1 receipts and new V2 receipts" ) ;
211218 ( escrow_accounts_v1, escrow_accounts_v2)
212219 } else {
213220 tracing:: info!( "TAP Agent: Legacy mode - V1 receipts only" ) ;
214- ( escrow_accounts_v1, escrow_accounts_v2) // Still keep V2 watcher for consistency
221+ ( escrow_accounts_v1, escrow_accounts_v2)
215222 } ;
216223
217224 let config = Box :: leak ( Box :: new ( {
0 commit comments