From 19cd17e3c15d82d52e76581a1e2ed30f4d3d4064 Mon Sep 17 00:00:00 2001 From: Tony Giorgio Date: Wed, 8 May 2024 20:36:41 -0500 Subject: [PATCH] Don't save twice after fedimint deposit happens --- mutiny-core/src/federation.rs | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/mutiny-core/src/federation.rs b/mutiny-core/src/federation.rs index 527041e8e..12ada9065 100644 --- a/mutiny-core/src/federation.rs +++ b/mutiny-core/src/federation.rs @@ -1704,7 +1704,7 @@ async fn process_onchain_deposit_outcome( let output = tx.btc_transaction.output[tx.out_idx as usize].clone(); // store as confirmed 0 block height until we can check esplora after - let updated_transaction_details = TransactionDetails { + let transaction_details_update = TransactionDetails { transaction: None, txid: Some(txid), internal_id, @@ -1715,17 +1715,8 @@ async fn process_onchain_deposit_outcome( labels: labels.clone(), }; - match persist_transaction_details(&storage, &updated_transaction_details) { - Ok(_) => { - log_info!(logger, "Transaction updated"); - }, - Err(e) => { - log_error!(logger, "Error updating transaction: {e}"); - }, - } - // we need to get confirmations for this txid and update - subscribe_onchain_confirmation_check(storage.clone(), esplora.clone(), txid, updated_transaction_details, stop.clone(), logger.clone()).await; + subscribe_onchain_confirmation_check(storage.clone(), esplora.clone(), txid, transaction_details_update, stop.clone(), logger.clone()).await; } fedimint_wallet_client::DepositState::Claimed(_) => { // Nothing really to change from confirmed to claimed