File tree 1 file changed +17
-2
lines changed
1 file changed +17
-2
lines changed Original file line number Diff line number Diff line change @@ -446,10 +446,25 @@ impl SharedBuilder {
446
446
let block_status_map = Arc :: new ( DashMap :: new ( ) ) ;
447
447
448
448
let assume_valid_targets = Arc :: new ( Mutex :: new ( {
449
- if Self :: check_assume_valid_target_already_exists ( & sync_config, & snapshot) {
449
+ let not_exists_targets: Option < Vec < H256 > > =
450
+ sync_config. assume_valid_targets . map ( |targets| {
451
+ targets
452
+ . iter ( )
453
+ . filter ( |& target_hash| {
454
+ let exists = snapshot. block_exists ( target_hash) ;
455
+ if exists {
456
+ info ! ( "assume valid target 0x{} already exists in db" , target_hash) ;
457
+ }
458
+ exists
459
+ } )
460
+ . collect :: < Vec < H256 > > ( )
461
+ } ) ;
462
+
463
+ if not_exists_targets. is_some_and ( |targets| targets. is_empty ( ) ) {
464
+ info ! ( "all assume valid targets is already in db, CKB will do full verification from now on" ) ;
450
465
None
451
466
} else {
452
- sync_config . assume_valid_targets . clone ( )
467
+ not_exists_targets
453
468
}
454
469
} ) ) ;
455
470
You can’t perform that action at this time.
0 commit comments