@@ -12,7 +12,7 @@ use crate::core::{
12
12
} ;
13
13
use crate :: db:: {
14
14
find_latest_inscription_block_height, initialize_hord_db, insert_entry_in_blocks,
15
- open_readonly_hord_db_conn, open_readwrite_hord_dbs, InscriptionHeigthHint , LazyBlock ,
15
+ open_readonly_hord_db_conn, open_readwrite_hord_dbs, InscriptionHeigthHint , LazyBlock , find_latest_transfers_block_height ,
16
16
} ;
17
17
use crate :: scan:: bitcoin:: process_block_with_predicates;
18
18
use crate :: service:: http_api:: { load_predicates_from_redis, start_predicate_api_server} ;
@@ -59,7 +59,6 @@ impl Service {
59
59
// std::thread::sleep(std::time::Duration::from_secs(1200));
60
60
61
61
let _ = initialize_hord_db ( & self . config . expected_cache_path ( ) , & self . ctx ) ;
62
-
63
62
// Force rebuild
64
63
// {
65
64
// let blocks_db = open_readwrite_hord_db_conn_rocks_db(
@@ -107,16 +106,17 @@ impl Service {
107
106
} )
108
107
. expect ( "unable to spawn thread" ) ;
109
108
110
- let tip = {
109
+
110
+ let ( cursor, tip) = {
111
111
let inscriptions_db_conn =
112
112
open_readonly_hord_db_conn ( & self . config . expected_cache_path ( ) , & self . ctx ) ?;
113
+ let cursor = find_latest_transfers_block_height ( & inscriptions_db_conn, & self . ctx ) . unwrap_or ( 1 ) ;
113
114
match find_latest_inscription_block_height ( & inscriptions_db_conn, & self . ctx ) ? {
114
- Some ( height) => height,
115
+ Some ( height) => ( cursor , height) ,
115
116
None => panic ! ( ) ,
116
117
}
117
118
} ;
118
-
119
- self . replay_transfers ( 775808 , tip, Some ( tx_replayer. clone ( ) ) )
119
+ self . replay_transfers ( cursor, tip, Some ( tx_replayer. clone ( ) ) )
120
120
. await ?;
121
121
self . update_state ( Some ( tx_replayer. clone ( ) ) ) . await ?;
122
122
0 commit comments