Skip to content

Commit b79a7de

Browse files
committed
added fixmes for wallet save
1 parent 4dc0ccd commit b79a7de

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

zingolib/src/lightclient.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -483,6 +483,7 @@ impl LightClient {
483483
.generate_unified_address(desired_receivers)
484484
.map_err(|e| e.to_string())?;
485485

486+
// FIXME: zingo2, rework wallet save to save while the wallet guard is acquired
486487
if SyncMode::from_atomic_u8(self.sync_mode.clone()) == SyncMode::NotRunning {
487488
self.save_internal_rust().await?;
488489
}

zingolib/src/lightclient/send.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,9 @@ pub mod send_with_proposal {
103103
) -> Result<NonEmpty<TxId>, CompleteAndBroadcastError> {
104104
let mut wallet = self.wallet.lock().await;
105105
let calculated_txids = wallet.create_transactions(proposal).await?;
106+
107+
// FIXME: zingo2, save wallet here in case send fails and tx is lost
108+
106109
let broadcast_result = wallet
107110
.broadcast_calculated_transactions(self.get_server_uri(), calculated_txids)
108111
.await;

0 commit comments

Comments
 (0)