private BlockHeader lookupPreviousHeader(
      final MutableBlockchain blockchain, final BlockHeader header) {
    try {
      return blockchain
          .getBlockHeader(header.getParentHash())
          .orElseThrow(
              () ->
                  new IllegalStateException(
                      String.format(
                          "Block %s does not connect to the existing chain. Current chain head %s",
                          header.getNumber(), blockchain.getChainHeadBlockNumber())));
    } catch (IllegalStateException e) {
      LOG.info("Block {} does not connect to the existing chain.", header.getNumber());
    }
    return null;
  }
Import blockchain.

@param blocks the blocks
@param besuController the besu controller
@param skipPowValidation the skip pow validation
@param startBlock the start block
@param endBlock the end block
@return the rlp block importer - import result
@throws IOException the io exception
app/src/main/java/org/hyperledger/besu/chainimport/RlpBlockImporter.java