@Override
  public void verifyDifficultyTransitions(
      StoredBlock prevBlock, Block added, NetworkParameters params) {
    int diffMode = 1;
    final int heightInc = prevBlock.getHeight() + 1;
    if (CoinDefinition.TEST_NETWORK_STANDARD.equals(params.getStandardNetworkId())) {
      if (heightInc >= 2000) {
        diffMode = 4;
      }
    } else {
      if (heightInc >= 68589) {
        diffMode = 4;
      } else if (heightInc >= 34140) {
        diffMode = 3;
      } else if (heightInc >= 15200) {
        diffMode = 2;
      }
    }

    try {
      switch (diffMode) {
        case 4:
          darkGravityWave3Check(
              prevBlock, added, linearExtension.getBlockChain().getBlockStore(), params);
          return;
        case 1:
          linearExtension.verifyDifficultyTransitions(prevBlock, added, params);
          return;
        case 2:
          kimotoGravityWellCheck(
              prevBlock, added, linearExtension.getBlockChain().getBlockStore(), params);
          return;
        case 3:
          darkGravityWaveCheck(
              prevBlock, added, linearExtension.getBlockChain().getBlockStore(), params);
          return;
        default:
          throw new RuntimeException("Unreachable");
      }
    } catch (BlockStoreException ex) {
      throw new VerificationException(
          "Block store exception during difficulty transitions check", ex);
    }
  }
  @Nullable
  Sha256Hash getHashByHeight(int height) {
    Preconditions.checkArgument(height >= 0, "Height mustn't be negative");

    final AbstractBlockChain blockChain = linearExtension.getBlockChain();
    StoredBlock currentBlock = blockChain.getChainHead();
    if (currentBlock == null || currentBlock.getHeight() < height) {
      return null;
    }

    final BlockStore blockStore = blockChain.getBlockStore();
    try {
      while (currentBlock.getHeight() > height) {
        currentBlock = currentBlock.getPrev(blockStore);
        if (currentBlock == null) return null;
      }
      return currentBlock.getHeader().getHash();
    } catch (BlockStoreException ex) {
      log.error("Error while descending the chain", ex);
      return null;
    }
  }
 public AbstractBlockChain getBlockChain() {
   return linearExtension.getBlockChain();
 }