File tree Expand file tree Collapse file tree 2 files changed +18
-0
lines changed
mithril-aggregator/src/services Expand file tree Collapse file tree 2 files changed +18
-0
lines changed Original file line number Diff line number Diff line change 1+ use std:: mem;
12use std:: ops:: Range ;
23use std:: path:: { Path , PathBuf } ;
34use std:: sync:: Arc ;
@@ -155,6 +156,14 @@ impl CardanoTransactionsImporter {
155156
156157 let merkle_root = MKTree :: new ( & transactions) ?. compute_root ( ) ?;
157158 block_ranges_with_merkle_root. push ( ( block_range, merkle_root) ) ;
159+
160+ if block_ranges_with_merkle_root. len ( ) >= 100 {
161+ let block_ranges_with_merkle_root_save =
162+ mem:: take ( & mut block_ranges_with_merkle_root) ;
163+ self . transaction_store
164+ . store_block_range_roots ( block_ranges_with_merkle_root_save)
165+ . await ?;
166+ }
158167 }
159168
160169 self . transaction_store
Original file line number Diff line number Diff line change 1+ use std:: mem;
12use std:: ops:: Range ;
23use std:: path:: { Path , PathBuf } ;
34use std:: sync:: Arc ;
@@ -155,6 +156,14 @@ impl CardanoTransactionsImporter {
155156
156157 let merkle_root = MKTree :: new ( & transactions) ?. compute_root ( ) ?;
157158 block_ranges_with_merkle_root. push ( ( block_range, merkle_root) ) ;
159+
160+ if block_ranges_with_merkle_root. len ( ) >= 100 {
161+ let block_ranges_with_merkle_root_save =
162+ mem:: take ( & mut block_ranges_with_merkle_root) ;
163+ self . transaction_store
164+ . store_block_range_roots ( block_ranges_with_merkle_root_save)
165+ . await ?;
166+ }
158167 }
159168
160169 self . transaction_store
You can’t perform that action at this time.
0 commit comments