Skip to content

Commit e3a1c51

Browse files
committed
Consistent handling of conditional messages
1 parent e1d95ff commit e3a1c51

File tree

1 file changed

+10
-11
lines changed

1 file changed

+10
-11
lines changed

src/main/scala/io/iohk/ethereum/blockchain/sync/regular/BlockImporter.scala

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -73,18 +73,17 @@ class BlockImporter(
7373
false,
7474
true)(state)
7575

76-
case nc @ NewCheckpoint(block) =>
77-
if (state.importing) {
78-
//We don't want to lose a checkpoint
76+
//We don't want to lose a checkpoint
77+
case nc @ NewCheckpoint(_) if state.importing =>
7978
context.system.scheduler.scheduleOnce(1.second, self, nc)
80-
} else {
81-
importBlock(
82-
block,
83-
new CheckpointBlockImportMessages(block),
84-
CheckpointBlockImport,
85-
false,
86-
true)(state)
87-
}
79+
80+
case NewCheckpoint(block) if !state.importing =>
81+
importBlock(
82+
block,
83+
new CheckpointBlockImportMessages(block),
84+
CheckpointBlockImport,
85+
false,
86+
true)(state)
8887

8988
case ImportNewBlock(block, peerId) if state.isOnTop && !state.importing =>
9089
importBlock(

0 commit comments

Comments
 (0)