@@ -17,6 +17,7 @@ use crate::{
17
17
pub fn start_block_archiving_processor (
18
18
config : & Config ,
19
19
ctx : & Context ,
20
+ update_tip : bool ,
20
21
_post_processor : Option < Sender < BitcoinBlockData > > ,
21
22
) -> PostProcessorController {
22
23
let ( commands_tx, commands_rx) = crossbeam_channel:: bounded :: < PostProcessorCommand > ( 2 ) ;
@@ -66,7 +67,7 @@ pub fn start_block_archiving_processor(
66
67
}
67
68
} ,
68
69
} ;
69
- store_compacted_blocks ( compacted_blocks, & blocks_db_rw, & ctx) ;
70
+ store_compacted_blocks ( compacted_blocks, update_tip , & blocks_db_rw, & ctx) ;
70
71
}
71
72
72
73
if let Err ( e) = blocks_db_rw. flush ( ) {
@@ -86,13 +87,20 @@ pub fn start_block_archiving_processor(
86
87
87
88
pub fn store_compacted_blocks (
88
89
mut compacted_blocks : Vec < ( u64 , LazyBlock ) > ,
90
+ update_tip : bool ,
89
91
blocks_db_rw : & DB ,
90
92
ctx : & Context ,
91
93
) {
92
94
compacted_blocks. sort_by ( |( a, _) , ( b, _) | a. cmp ( b) ) ;
93
95
94
96
for ( block_height, compacted_block) in compacted_blocks. into_iter ( ) {
95
- insert_entry_in_blocks ( block_height as u32 , & compacted_block, & blocks_db_rw, & ctx) ;
97
+ insert_entry_in_blocks (
98
+ block_height as u32 ,
99
+ & compacted_block,
100
+ update_tip,
101
+ & blocks_db_rw,
102
+ & ctx,
103
+ ) ;
96
104
ctx. try_log ( |logger| {
97
105
info ! ( logger, "Block #{block_height} saved to disk" ) ;
98
106
} ) ;
0 commit comments