From 75ac468a840131ecc827559afb41f68cc9929a06 Mon Sep 17 00:00:00 2001 From: NicolasCantu Date: Fri, 17 Jan 2025 18:15:57 +0100 Subject: [PATCH] Update process when commiting new state --- src/commit.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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)