File tree 1 file changed +16
-8
lines changed
1 file changed +16
-8
lines changed Original file line number Diff line number Diff line change @@ -199,14 +199,22 @@ impl ConsumeUnverifiedBlockProcessor {
199
199
switch : Option < Switch > ,
200
200
) -> VerifyResult {
201
201
let switch: Switch = switch. unwrap_or_else ( || {
202
- let mut assume_valid_target = self . shared . assume_valid_target ( ) ;
203
- match * assume_valid_target {
204
- Some ( ref target) => {
205
- // if the target has been reached, delete it
206
- if target
207
- == & ckb_types:: prelude:: Unpack :: < H256 > :: unpack ( & BlockView :: hash ( block) )
208
- {
209
- assume_valid_target. take ( ) ;
202
+ let mut assume_valid_targets = self . shared . assume_valid_targets ( ) ;
203
+ match * assume_valid_targets {
204
+ Some ( ref mut targets) => {
205
+ //
206
+ let block_hash: H256 =
207
+ ckb_types:: prelude:: Unpack :: < H256 > :: unpack ( & BlockView :: hash ( block) ) ;
208
+ if targets. first ( ) . eq ( & Some ( & block_hash) ) {
209
+ targets. remove ( 0 ) ;
210
+ info ! ( "CKB reached one assume_valid_target: 0x{}" , block_hash) ;
211
+ }
212
+
213
+ if targets. is_empty ( ) {
214
+ assume_valid_targets. take ( ) ;
215
+ info ! (
216
+ "CKB reached all assume_valid_targets, will do full verification now"
217
+ ) ;
210
218
Switch :: NONE
211
219
} else {
212
220
Switch :: DISABLE_SCRIPT
You can’t perform that action at this time.
0 commit comments