code: func (tx *transaction) hasKey(key []byte) bool {
  	// When the transaction is writable, check the pending transaction
  	// state first.
  	if tx.writable {
  		if tx.pendingRemove.Has(key) {
  			return false
  		}
  		if tx.pendingKeys.Has(key) {
  			return true
  		}
  	}
  
  	// Consult the database cache and underlying database.
  	return tx.snapshot.Has(key)
  }
docs: // hasKey returns whether or not the provided key exists in the database while
  // taking into account the current transaction state.