From ee3544a1c4062dd70e7ae5f94a0db8f2dc5f3d06 Mon Sep 17 00:00:00 2001 From: Philipp Hoenisch Date: Fri, 24 May 2024 17:00:05 +1000 Subject: [PATCH] fix: Unreserve utxos on wallet sync 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. --- crates/xxi-node/src/node/wallet.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/crates/xxi-node/src/node/wallet.rs b/crates/xxi-node/src/node/wallet.rs index c07be697f..64acfcd37 100644 --- a/crates/xxi-node/src/node/wallet.rs +++ b/crates/xxi-node/src/node/wallet.rs @@ -114,6 +114,10 @@ impl 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(()) }