@@ -40,7 +40,8 @@ use indexer_config::{
40
40
SubgraphConfig , SubgraphsConfig , TapConfig ,
41
41
} ;
42
42
use 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 ,
44
45
} ;
45
46
use ractor:: { concurrency:: JoinHandle , Actor , ActorRef } ;
46
47
use sender_account:: SenderAccountConfig ;
@@ -165,16 +166,6 @@ pub async fn start_agent() -> (ActorRef<SenderAccountsManagerMessage>, JoinHandl
165
166
. await
166
167
. expect ( "Error creating escrow_accounts channel" ) ;
167
168
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
-
178
169
// Determine if we should check for Horizon contracts and potentially enable hybrid mode:
179
170
// - If horizon.enabled = false: Pure legacy mode, no Horizon detection
180
171
// - 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
205
196
false
206
197
} ;
207
198
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
+
208
215
// In both modes we need both watchers for the hybrid processing
209
216
let ( escrow_accounts_v1_final, escrow_accounts_v2_final) = if is_horizon_enabled {
210
217
tracing:: info!( "TAP Agent: Horizon migration mode - processing existing V1 receipts and new V2 receipts" ) ;
211
218
( escrow_accounts_v1, escrow_accounts_v2)
212
219
} else {
213
220
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)
215
222
} ;
216
223
217
224
let config = Box :: leak ( Box :: new ( {
0 commit comments