code: func (tx *transaction) hasBlock(hash *chainhash.Hash) bool {
  	// Return true if the block is pending to be written on commit since
  	// it exists from the viewpoint of this transaction.
  	if _, exists := tx.pendingBlocks[*hash]; exists {
  		return true
  	}
  
  	return tx.hasKey(bucketizedKey(blockIdxBucketID, hash[:]))
  }
docs: // hasBlock returns whether or not a block with the given hash exists.