Skip to content

Commit d9c5bc7

Browse files
committed
feat: expose Wallet::unmark_used
1 parent cc7e216 commit d9c5bc7

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

bdk-ffi/src/wallet.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,18 @@ impl Wallet {
241241
self.get_wallet().mark_used(keychain, index)
242242
}
243243

244+
/// Undoes the effect of [`mark_used`] and returns whether the `index` was inserted
245+
/// back into the unused set.
246+
///
247+
/// Since this is only a superficial marker, it will have no effect if the address at the given
248+
/// `index` was actually used, i.e. the wallet has previously indexed a tx output for the
249+
/// derived spk.
250+
///
251+
/// [`mark_used`]: Self::mark_used
252+
pub fn unmark_used(&self, keychain: KeychainKind, index: u32) -> bool {
253+
self.get_wallet().unmark_used(keychain, index)
254+
}
255+
244256
/// Reveal addresses up to and including the target `index` and return an iterator
245257
/// of newly revealed addresses.
246258
///

0 commit comments

Comments
 (0)