///
/// let (graph, reindex_cs) =
/// IndexedTxGraph::from_changeset(persisted_changeset, move |idx_cs| -> anyhow::Result<_> {
- /// // e.g. KeychainTxOutIndex needs descriptors that weren’t in its CS
+ /// // e.g. KeychainTxOutIndex needs descriptors that weren’t in its change set.
/// let mut idx = KeychainTxOutIndex::from_changeset(DEFAULT_LOOKAHEAD, true, idx_cs);
/// if let Some(desc) = persisted_desc {
/// idx.insert_descriptor("external", desc)?;
}
impl<K> KeychainTxOutIndex<K> {
- /// Construct a [`KeychainTxOutIndex`] with the given `lookahead` and `use_spk_cache` boolean.
+ /// Construct a [`KeychainTxOutIndex`] with the given `lookahead` and `persist_spks` boolean.
///
/// # Lookahead
///
///
/// ```rust
/// # use bdk_chain::keychain_txout::KeychainTxOutIndex;
- /// // Derive 20 future addresses per chain and persist + reload script pubkeys via ChangeSets:
+ /// // Derive 20 future addresses per keychain and persist + reload script pubkeys via ChangeSets:
/// let idx = KeychainTxOutIndex::<&'static str>::new(20, true);
///
- /// // Derive 10 future addresses per chain without persistence:
+ /// // Derive 10 future addresses per keychain without persistence:
/// let idx = KeychainTxOutIndex::<&'static str>::new(10, false);
/// ```
pub fn new(lookahead: u32, persist_spks: bool) -> Self {
impl<K: Clone + Ord + Debug> KeychainTxOutIndex<K> {
/// Construct `KeychainTxOutIndex<K>` from the given `changeset`.
///
- /// Shorthand for called [`new`] and then [`apply_changeset`].
+ /// Shorthand for calling [`new`] and then [`apply_changeset`].
///
/// [`new`]: Self::new
/// [`apply_changeset`]: Self::apply_changeset
///
/// It tracks:
/// 1. `last_revealed`: the highest derivation index revealed per descriptor.
-/// 2. `spks`: the cache of derived script pubkeys to persist across runs.
+/// 2. `spk_cache`: the cache of derived script pubkeys to persist across runs.
///
/// You can apply a `ChangeSet` to a `KeychainTxOutIndex` via
/// [`KeychainTxOutIndex::apply_changeset`], or merge two change sets with [`ChangeSet::merge`].
///
/// - `last_revealed` is monotonic: merging retains the maximum index for each descriptor and never
/// decreases.
-/// - `spks` accumulates entries: once a script pubkey is persisted, it remains available for
+/// - `spk_cache` accumulates entries: once a script pubkey is persisted, it remains available for
/// reload. If the same descriptor and index appear again with a new script pubkey, the latter
/// value overrides the former.
///