Skip to content

Commit

Permalink
feat: explicitly handle 'UtxoDoesNotExistError' from sync
Browse files Browse the repository at this point in the history
  • Loading branch information
vindard committed Dec 15, 2024
1 parent 9ddfe63 commit 283aa71
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/job/sync_wallet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -507,10 +507,18 @@ pub async fn execute(
bdk_txs
.delete_transaction_if_no_more_utxos_exist(&mut tx, outpoint)
.await?;
let detected_txn_id = deps
let detected_txn_id = match deps
.bria_utxos
.delete_utxo(&mut tx, outpoint, keychain_id)
.await?;
.await
{
Ok(txn_id) => txn_id,
Err(UtxoError::UtxoDoesNotExistError) => {
tx.commit().await?;
continue;
}
Err(err) => Err(err)?,
};
match deps
.ledger
.utxo_dropped(tx, LedgerTransactionId::new(), detected_txn_id)
Expand Down

0 comments on commit 283aa71

Please sign in to comment.