Skip to content
This repository was archived by the owner on Feb 3, 2025. It is now read-only.

Commit 1402e5d

Browse files
committed
Small fixes for bdk sync
1 parent 2fee185 commit 1402e5d

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

mutiny-core/src/onchain.rs

+9-2
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,13 @@ impl<S: MutinyStorage> OnChainWallet<S> {
198198
}
199199
};
200200

201+
log_debug!(
202+
self.logger,
203+
"BDK Syncing {} addresses, {} txids",
204+
spks.len(),
205+
txids.len()
206+
);
207+
201208
let update_graph = self
202209
.blockchain
203210
.sync(spks, txids, core::iter::empty(), 5)
@@ -291,14 +298,14 @@ impl<S: MutinyStorage> OnChainWallet<S> {
291298
self.sync().await?
292299
}
293300
}
294-
ConfirmationTime::Unconfirmed { .. } => {
301+
ConfirmationTime::Unconfirmed { last_seen } => {
295302
// if the transaction is unconfirmed, we can just insert it
296303
let mut wallet = self.wallet.try_write()?;
297304

298305
// if we already have the transaction, we don't need to insert it
299306
if wallet.get_tx(tx.txid()).is_none() {
300307
// insert tx and commit changes
301-
wallet.insert_tx(tx, position)?;
308+
wallet.apply_unconfirmed_txs([(&tx, last_seen)]);
302309
wallet.commit()?;
303310
} else {
304311
log_debug!(

0 commit comments

Comments
 (0)