[bug] deadlock in commit
This commit is contained in:
parent
4ec25d1494
commit
292b7135ab
@ -13,7 +13,7 @@ use sdk_common::sp_client::bitcoin::{Amount, Transaction, OutPoint};
|
|||||||
use sdk_common::process::{Process, ProcessState, CACHEDPROCESSES};
|
use sdk_common::process::{Process, ProcessState, CACHEDPROCESSES};
|
||||||
use serde_json::json;
|
use serde_json::json;
|
||||||
|
|
||||||
use crate::{lock_freezed_utxos, MutexExt, DAEMON, WALLET};
|
use crate::{lock_freezed_utxos, MutexExt, DAEMON, LISTS, WALLET};
|
||||||
|
|
||||||
pub(crate) fn handle_commit_request(commit_msg: CommitMessage) -> Result<OutPoint> {
|
pub(crate) fn handle_commit_request(commit_msg: CommitMessage) -> Result<OutPoint> {
|
||||||
// Attempt to process the initial transaction or reference
|
// Attempt to process the initial transaction or reference
|
||||||
@ -193,7 +193,7 @@ fn commit_new_transaction(
|
|||||||
.checked_div(1000)
|
.checked_div(1000)
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
|
||||||
let freezed_utxos = lock_freezed_utxos()?;
|
let mut freezed_utxos = lock_freezed_utxos()?;
|
||||||
|
|
||||||
let psbt = create_transaction(
|
let psbt = create_transaction(
|
||||||
vec![mandatory_input],
|
vec![mandatory_input],
|
||||||
@ -211,7 +211,7 @@ fn commit_new_transaction(
|
|||||||
let txid = daemon.broadcast(&new_tx)?;
|
let txid = daemon.broadcast(&new_tx)?;
|
||||||
let commited_in = OutPoint::new(txid, 0);
|
let commited_in = OutPoint::new(txid, 0);
|
||||||
|
|
||||||
lock_freezed_utxos()?.insert(commited_in);
|
freezed_utxos.insert(commited_in);
|
||||||
commitment.update_states_tip(commited_in)?;
|
commitment.update_states_tip(commited_in)?;
|
||||||
|
|
||||||
Ok(commited_in)
|
Ok(commited_in)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user