Skip to content

Commit

Permalink
Merge pull request #1177 from MutinyWallet/fedimint-onchain-dont-save…
Browse files Browse the repository at this point in the history
…-twice

Don't save twice after fedimint deposit happens
  • Loading branch information
TonyGiorgio authored May 9, 2024
2 parents 816782a + 19cd17e commit 19bee5e
Showing 1 changed file with 2 additions and 11 deletions.
13 changes: 2 additions & 11 deletions mutiny-core/src/federation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1704,7 +1704,7 @@ async fn process_onchain_deposit_outcome<S: MutinyStorage>(
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,
Expand All @@ -1715,17 +1715,8 @@ async fn process_onchain_deposit_outcome<S: MutinyStorage>(
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
Expand Down

0 comments on commit 19bee5e

Please sign in to comment.