code: func (b *BlockChain) BlockByHeight(blockHeight int32) (*btcutil.Block, error) {
  	// Lookup the block height in the best chain.
  	node := b.bestChain.NodeByHeight(blockHeight)
  	if node == nil {
  		str := fmt.Sprintf("no block at height %d exists", blockHeight)
  		return nil, errNotInMainChain(str)
  	}
  
  	// Load the block from the database and return it.
  	var block *btcutil.Block
  	err := b.db.View(func(dbTx database.Tx) error {
  		var err error
  		block, err = dbFetchBlockByNode(dbTx, node)
  		return err
  	})
  	return block, err
  }
docs: // BlockByHeight returns the block at the given height in the main chain.
  //
  // This function is safe for concurrent access.