Skip to content

Commit c9467dc

Browse files
committed
chore: improve documentation of lookahead
1 parent bc796f4 commit c9467dc

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

crates/chain/src/keychain/txout_index.rs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -117,11 +117,12 @@ impl<K: Clone + Ord + Debug> Indexer for KeychainTxOutIndex<K> {
117117
impl<K> KeychainTxOutIndex<K> {
118118
/// Construct a [`KeychainTxOutIndex`] with the given `lookahead`.
119119
///
120-
/// The lookahead is the number of scripts to cache ahead of the last revealed script index.
121-
/// This is useful to find outputs you own when processing block data that lie beyond the last
122-
/// revealed index. In certain situations, such as when performing an initial scan of the
123-
/// blockchain during wallet import, it may be uncertain or unknown what the last revealed index
124-
/// is.
120+
/// The `lookahead` is the number of script pubkeys to derive and cache from the internal
121+
/// descriptors over and above the last revealed script index. Without a lookahead the index
122+
/// will miss outputs you own when processing transactions whose output script pubkeys lie
123+
/// beyond the last revealed index. In certain situations, such as when performing an initial
124+
/// scan of the blockchain during wallet import, it may be uncertain or unknown what the index
125+
/// of the last revealed script pubkey actually is.
125126
pub fn new(lookahead: u32) -> Self {
126127
Self {
127128
inner: SpkTxOutIndex::default(),

0 commit comments

Comments
 (0)