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;
1
2
use std:: ops:: Range ;
2
3
use std:: path:: { Path , PathBuf } ;
3
4
use std:: sync:: Arc ;
@@ -155,6 +156,14 @@ impl CardanoTransactionsImporter {
155
156
156
157
let merkle_root = MKTree :: new ( & transactions) ?. compute_root ( ) ?;
157
158
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
+ }
158
167
}
159
168
160
169
self . transaction_store
Original file line number Diff line number Diff line change
1
+ use std:: mem;
1
2
use std:: ops:: Range ;
2
3
use std:: path:: { Path , PathBuf } ;
3
4
use std:: sync:: Arc ;
@@ -155,6 +156,14 @@ impl CardanoTransactionsImporter {
155
156
156
157
let merkle_root = MKTree :: new ( & transactions) ?. compute_root ( ) ?;
157
158
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
+ }
158
167
}
159
168
160
169
self . transaction_store
You can’t perform that action at this time.
0 commit comments