code: func dbFetchTxIndexEntry(dbTx database.Tx, txHash *chainhash.Hash) (*database.BlockRegion, error) {
  	// Load the record from the database and return now if it doesn't exist.
  	txIndex := dbTx.Metadata().Bucket(txIndexKey)
  	serializedData := txIndex.Get(txHash[:])
  	if len(serializedData) == 0 {
  		return nil, nil
  	}
  
  	// Ensure the serialized data has enough bytes to properly deserialize.
  	if len(serializedData) < 12 {
  		return nil, database.Error{
  			ErrorCode: database.ErrCorruption,
  			Description: fmt.Sprintf("corrupt transaction index "+
  				"entry for %s", txHash),
  		}
  	}
  
  	// Load the block hash associated with the block ID.
  	hash, err := dbFetchBlockHashBySerializedID(dbTx, serializedData[0:4])
  	if err != nil {
  		return nil, database.Error{
  			ErrorCode: database.ErrCorruption,
  			Description: fmt.Sprintf("corrupt transaction index "+
  				"entry for %s: %v", txHash, err),
  		}
  	}
  
  	// Deserialize the final entry.
  	region := database.BlockRegion{Hash: &chainhash.Hash{}}
  	copy(region.Hash[:], hash[:])
  	region.Offset = byteOrder.Uint32(serializedData[4:8])
  	region.Len = byteOrder.Uint32(serializedData[8:12])
  
  	return &region, nil
  }
docs: // dbFetchTxIndexEntry uses an existing database transaction to fetch the block
  // region for the provided transaction hash from the transaction index.  When
  // there is no entry for the provided hash, nil will be returned for the both
  // the region and the error.