We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c2f78a3 commit 1e222c4Copy full SHA for 1e222c4
src/main/scala/io/iohk/ethereum/blockchain/sync/regular/BlockFetcherState.scala
@@ -130,9 +130,10 @@ case class BlockFetcherState(
130
}
131
132
private def checkConsistencyWithReadyBlocks(headers: Seq[BlockHeader]): Boolean = {
133
- if (waitingHeaders.isEmpty) {
134
- (readyBlocks.lastOption.map(_.header), headers.headOption).mapN(_ isParentOf _).getOrElse(true)
135
- } else true
+ (readyBlocks, headers) match {
+ case (_ :+ last, head +: _) if waitingHeaders.isEmpty => last.header isParentOf head
+ case _ => true
136
+ }
137
138
139
def validateNewBlockHashes(hashes: Seq[BlockHash]): Either[String, Seq[BlockHash]] =
0 commit comments