@@ -15,6 +15,7 @@ use sv_publisher::{
15
15
gaps:: { find_next_block_to_save, BlockHeightGap } ,
16
16
metrics:: Metrics ,
17
17
publish:: publish_block,
18
+ recover:: recover_tx_pointers,
18
19
state:: ServerState ,
19
20
} ;
20
21
use tokio:: { sync:: Semaphore , task:: JoinSet } ;
@@ -52,8 +53,9 @@ async fn main() -> anyhow::Result<()> {
52
53
tokio:: select! {
53
54
result = async {
54
55
tokio:: join!(
56
+ recover_tx_pointers( & db) ,
55
57
process_historical_blocks(
56
- cli. from_height . into( ) ,
58
+ cli. from_block . into( ) ,
57
59
& message_broker,
58
60
& fuel_core,
59
61
& last_block_height,
@@ -72,6 +74,7 @@ async fn main() -> anyhow::Result<()> {
72
74
} => {
73
75
result. 0 ?;
74
76
result. 1 ?;
77
+ result. 2 ?;
75
78
}
76
79
_ = shutdown. wait_for_shutdown( ) => {
77
80
tracing:: info!( "Shutdown signal received, waiting for processing to complete..." ) ;
@@ -124,7 +127,7 @@ async fn process_live_blocks(
124
127
}
125
128
126
129
fn process_historical_blocks (
127
- from_height : BlockHeight ,
130
+ from_block : BlockHeight ,
128
131
message_broker : & Arc < NatsMessageBroker > ,
129
132
fuel_core : & Arc < dyn FuelCoreLike > ,
130
133
last_block_height : & Arc < BlockHeight > ,
@@ -145,7 +148,7 @@ fn process_historical_blocks(
145
148
}
146
149
147
150
let Some ( processed_gaps) =
148
- get_historical_block_range ( from_height , & gaps, last_block_height)
151
+ get_historical_block_range ( from_block , & gaps, last_block_height)
149
152
else {
150
153
return Ok ( ( ) ) ;
151
154
} ;
@@ -242,7 +245,7 @@ async fn process_blocks_with_join_set(
242
245
}
243
246
244
247
fn get_historical_block_range (
245
- from_height : BlockHeight ,
248
+ from_block : BlockHeight ,
246
249
gaps : & [ BlockHeightGap ] ,
247
250
last_block_height : BlockHeight ,
248
251
) -> Option < Vec < BlockHeightGap > > {
@@ -252,7 +255,7 @@ fn get_historical_block_range(
252
255
253
256
let mut processed_gaps = Vec :: new ( ) ;
254
257
for gap in gaps {
255
- let start = std:: cmp:: max ( from_height , gap. start ) ;
258
+ let start = std:: cmp:: max ( from_block , gap. start ) ;
256
259
let end = std:: cmp:: min ( gap. end , last_block_height) ;
257
260
258
261
if start <= end {
0 commit comments