Add simple duplicate state check on update_process
This commit is contained in:
parent
cf31bad168
commit
12f0fb23eb
17
src/api.rs
17
src/api.rs
@ -1303,19 +1303,10 @@ pub fn update_process(
|
||||
roles.clone()
|
||||
)?;
|
||||
|
||||
// TODO duplicate check is broken
|
||||
// // We compare the new state with the previous one
|
||||
// let last_state_merkle_root = &prev_state.state_id;
|
||||
|
||||
// if *last_state_merkle_root == new_state.state_id {
|
||||
// return Err(ApiError::new("new proposed state is identical to the previous commited state".to_owned()));
|
||||
// }
|
||||
|
||||
// // We check that we don't have already a similar concurrent state
|
||||
// let concurrent_processes = process.get_latest_concurrent_states()?;
|
||||
// if concurrent_processes.iter().any(|p| p.state_id == new_state.state_id) {
|
||||
// return Err(ApiError::new("New state already known".to_owned()));
|
||||
// }
|
||||
// We check that the new state doesn't already exist
|
||||
if process.get_state_for_id(&new_state.state_id).is_ok() {
|
||||
return Err(ApiError::new("New state already known".to_owned()));
|
||||
}
|
||||
|
||||
let diffs = create_diffs(&lock_local_device()?, &process, &new_state, &members_list)?;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user