code: func (b *BlockChain) CalcNextRequiredDifficulty(timestamp time.Time) (uint32, error) {
  	b.chainLock.Lock()
  	difficulty, err := b.calcNextRequiredDifficulty(b.bestChain.Tip(), timestamp)
  	b.chainLock.Unlock()
  	return difficulty, err
  }
docs: // CalcNextRequiredDifficulty calculates the required difficulty for the block
  // after the end of the current best chain based on the difficulty retarget
  // rules.
  //
  // This function is safe for concurrent access.