diff --git a/src/commit.rs b/src/commit.rs index 6384271..eebe1af 100644 --- a/src/commit.rs +++ b/src/commit.rs @@ -279,7 +279,7 @@ fn commit_new_transaction( return Err(Error::msg(format!("Missing next commitment outpoint for process {}", updated_process.get_process_id()?))); }; - let commitment_payload = Vec::from_hex(state_to_commit.state_id)?; + let commitment_payload = Vec::from_hex(state_to_commit.state_id.clone())?; let psbt = create_transaction( vec![mandatory_input], @@ -297,6 +297,8 @@ fn commit_new_transaction( let commited_in = OutPoint::new(txid, 0); freezed_utxos.insert(commited_in); + updated_process.remove_all_concurrent_states()?; + updated_process.insert_concurrent_state(state_to_commit)?; updated_process.update_states_tip(commited_in)?; Ok(commited_in)