txn.go
func (o *oracle) hasConflict(txn *Txn) bool {
	if len(txn.reads) == 0 {
		return false
	}
	for _, ro := range txn.reads {
		// A commit at the read timestamp is expected.
		// But, any commit after the read timestamp should cause a conflict.
		if ts, has := o.commits[ro]; has && ts > txn.readTs {
			return true
		}
	}
	return false
}
func (o *oracle) hasConflict(txn *Txn) bool {
	if len(txn.reads) == 0 {
		return false
	}
	for _, ro := range txn.reads {
		// A commit at the read timestamp is expected.
		// But, any commit after the read timestamp should cause a conflict.
		if ts, has := o.commits[ro]; has && ts > txn.readTs {
			return true
		}
	}
	return false
}
func ( o * oracle ) hasConflict ( txn * Txn ) bool { if len ( txn . reads ) == 0 { return false } for _ , ro := range txn . reads { // A commit at the read timestamp is expected. // But, any commit after the read timestamp should cause a conflict. if ts , has := o . commits [ ro ] ; has && ts > txn . readTs { return true } } return false }
// hasConflict must be called while having a lock.
hasConflict must be called while having a lock .