Skip to content

Commit

Permalink
fix: unreserve utxos
Browse files Browse the repository at this point in the history
on each blockchain sync we clear the lcoked utxos. This is fine, because we are syncing with the blockchain and are learning about all acutally spent utxos.
  • Loading branch information
bonomat committed May 24, 2024
1 parent 9a39e25 commit b7a1b33
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions crates/xxi-node/src/node/wallet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,9 @@ impl<D: BdkStorage, S: TenTenOneStorage, N: Storage + Send + Sync + 'static> Nod
/// Sync the state of the on-chain wallet against the blockchain.
pub async fn sync_on_chain_wallet(&self) -> Result<()> {
let client = &self.blockchain.esplora_client_async;
// On sync, we unlock our locked utxos, because we are syncing with the blockchain we will
// find already spent utxos and release those which were locked unnecessarily.
self.wallet.locked_utxos.lock().clear();

let (local_chain, unused_revealed_script_pubkeys, unconfirmed_txids, utxos) =
spawn_blocking({
Expand Down

0 comments on commit b7a1b33

Please sign in to comment.