Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't save twice after fedimint deposit happens #1177

Merged
merged 1 commit into from
May 9, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading