// When the value is greater than the currently saved value, replace it and return true.
// Otherwise, return false
When the value is greater than the currently saved value, replace it and return true.
Otherwise, return false
// When the value is greater than the currently saved value replace it and return true . // Otherwise return false
func (m *LastBlockMap) CAS(key ChainID, value Height) bool {
	m.lock.Lock()
	defer m.lock.Unlock()
	if v, e := m.M[key]; e && v >= value {
		return false
	} else {
		m.M[key] = value
	}
	return true
}
func ( m * LastBlockMap ) CAS ( key ChainID , value Height ) bool { m . lock . Lock ( ) defer m . lock . Unlock ( ) if v , e := m . M [ key ] ; e && v >= value { return false } else { m . M [ key ] = value } return true }
When the value is greater than the currently saved value, replace it and return true.
When the value is greater than the currently saved value replace it and return true .