Skip to content

Commit

Permalink
fix: Unreserve utxos on wallet sync
Browse files Browse the repository at this point in the history
On each blockchain sync we clear the locked utxos. This is fine, because we are syncing with the blockchain and are learning about all actually spent utxos.
  • Loading branch information
bonomat authored and holzeis committed May 24, 2024
1 parent 739d9dd commit ee3544a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions crates/xxi-node/src/node/wallet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,10 @@ impl<D: BdkStorage, S: TenTenOneStorage, N: Storage + Send + Sync + 'static> Nod
.await
.expect("task to complete")?;

// 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();

Ok(())
}

Expand Down

0 comments on commit ee3544a

Please sign in to comment.