code: func (tx *transaction) HasBlock(hash *chainhash.Hash) (bool, error) {
  	// Ensure transaction state is valid.
  	if err := tx.checkClosed(); err != nil {
  		return false, err
  	}
  
  	return tx.hasBlock(hash), nil
  }
docs: // HasBlock returns whether or not a block with the given hash exists in the
  // database.
  //
  // Returns the following errors as required by the interface contract:
  //   - ErrTxClosed if the transaction has already been closed
  //
  // This function is part of the database.Tx interface implementation.