From: github-actions Date: Thu, 11 Jan 2024 03:03:28 +0000 (+0000) Subject: Publish autogenerated nightly docs X-Git-Url: http://internal-gitweb-vhost/script/%22https:/database/scripts/struct.InsertBlockNotMatchingError.html?a=commitdiff_plain;h=e020bdb4c7c4e0fbc806fee326f39a7ca5d34895;p=bitcoindevkit.org Publish autogenerated nightly docs --- diff --git a/docs/.vuepress/public/docs-rs/bdk/nightly/latest/bdk_chain/keychain/struct.KeychainTxOutIndex.html b/docs/.vuepress/public/docs-rs/bdk/nightly/latest/bdk_chain/keychain/struct.KeychainTxOutIndex.html index fc170aa6b5..9020a0425c 100644 --- a/docs/.vuepress/public/docs-rs/bdk/nightly/latest/bdk_chain/keychain/struct.KeychainTxOutIndex.html +++ b/docs/.vuepress/public/docs-rs/bdk/nightly/latest/bdk_chain/keychain/struct.KeychainTxOutIndex.html @@ -34,7 +34,7 @@ will miss outputs you own when processing transactions whose output script pubke beyond the last revealed index. In certain situations, such as when performing an initial scan of the blockchain during wallet import, it may be uncertain or unknown what the index of the last revealed script pubkey actually is.

-

Return a reference to the internal SpkTxOutIndex.

+

Return a reference to the internal SpkTxOutIndex.

Get a reference to the set of indexed outpoints.

Return a reference to the internal map of the keychain to descriptors.

Add a keychain to the tracker’s txout_index with a descriptor to derive addresses.

@@ -46,15 +46,15 @@ and the txout index will discover transaction outputs with those script pubkeys.

Refer to new for more information on the lookahead.

Store lookahead scripts until target_index.

This does not change the lookahead setting.

-

Generates script pubkey iterators for every keychain. The iterators iterate over all +

Generates script pubkey iterators for every keychain. The iterators iterate over all derivable script pubkeys.

-

Generates a script pubkey iterator for the given keychain’s descriptor (if it exists). The +

Generates a script pubkey iterator for the given keychain’s descriptor (if it exists). The iterator iterates over all derivable scripts of the keychain’s descriptor.

Panics

This will panic if the keychain does not exist.

-

Convenience method to get revealed_spks_of_keychain of all keychains.

-

Iterates over the script pubkeys revealed by this index under keychain.

-

Get the next derivation index for keychain. The next index is the index after the last revealed +

Convenience method to get revealed_spks_of_keychain of all keychains.

+

Iterates over the script pubkeys revealed by this index under keychain.

+

Get the next derivation index for keychain. The next index is the index after the last revealed derivation index.

The second field in the returned tuple represents whether the next derivation index is new. There are two scenarios where the next derivation index is reused (not new):

@@ -65,11 +65,11 @@ There are two scenarios where the next derivation index is reused (not new):

Not checking the second field of the tuple may result in address reuse.

Panics

Panics if the keychain does not exist.

-

Get the last derivation index that is revealed for each keychain.

+

Get the last derivation index that is revealed for each keychain.

Keychains with no revealed indices will not be included in the returned BTreeMap.

-

Get the last derivation index revealed for keychain.

-

Convenience method to call Self::reveal_to_target on multiple keychains.

-

Reveals script pubkeys of the keychain’s descriptor up to and including the +

Get the last derivation index revealed for keychain.

+

Convenience method to call Self::reveal_to_target on multiple keychains.

+

Reveals script pubkeys of the keychain’s descriptor up to and including the target_index.

If the target_index cannot be reached (due to the descriptor having no wildcard and/or the target_index is in the hardened index range), this method will make a best-effort and @@ -79,7 +79,7 @@ reveal up to the last possible index.

pubkeys are revealed, then both of these will be empty.

Panics

Panics if keychain does not exist.

-

Attempts to reveal the next script pubkey for keychain.

+

Attempts to reveal the next script pubkey for keychain.

Returns the derivation index of the revealed script pubkey, the revealed script pubkey and a super::ChangeSet which represents changes in the last revealed index (if any).

When a new script cannot be revealed, we return the last revealed script and an empty @@ -90,7 +90,7 @@ pubkeys are revealed, then both of these will be empty.

Panics

Panics if the keychain does not exist.

-

Gets the next unused script pubkey in the keychain. I.e., the script pubkey with the lowest +

Gets the next unused script pubkey in the keychain. I.e., the script pubkey with the lowest index that has not been used yet.

This will derive and reveal a new script pubkey if no more unused script pubkeys exist.

If the descriptor has no wildcard and already has a used script pubkey or if a descriptor @@ -98,24 +98,24 @@ has used all scripts up to the derivation bounds, then the last derived script p returned.

Panics

Panics if keychain has never been added to the index

-

Marks the script pubkey at index as used even though the tracker hasn’t seen an output with it. +

Marks the script pubkey at index as used even though the tracker hasn’t seen an output with it. This only has an effect when the index had been added to self already and was unused.

Returns whether the index was initially present as unused.

This is useful when you want to reserve a script pubkey for something but don’t want to add the transaction output using it to the index yet. Other callers will consider index on keychain used until you call unmark_used.

-

Undoes the effect of mark_used. Returns whether the index is inserted back into +

Undoes the effect of mark_used. Returns whether the index is inserted back into unused.

Note that if self has scanned an output with this script pubkey, then this will have no effect.

-

Iterates over all unused script pubkeys for a keychain stored in the index.

-

Iterates over all the [OutPoint] that have a TxOut with a script pubkey derived from +

Iterates over all unused script pubkeys for a keychain stored in the index.

+

Iterates over all the [OutPoint] that have a TxOut with a script pubkey derived from keychain.

-

Returns the highest derivation index of the keychain where KeychainTxOutIndex has +

Returns the highest derivation index of the keychain where KeychainTxOutIndex has found a [TxOut] with it’s script pubkey.

-

Returns the highest derivation index of each keychain that KeychainTxOutIndex has found +

Returns the highest derivation index of each keychain that KeychainTxOutIndex has found a [TxOut] with it’s script pubkey.

-

Applies the derivation changeset to the KeychainTxOutIndex, extending the number of +

Applies the derivation changeset to the KeychainTxOutIndex, extending the number of derived scripts per keychain, as specified in the changeset.

Methods from Deref<Target = SpkTxOutIndex<(K, u32)>>§

Get a reference to the set of indexed outpoints.

Iterate over all known txouts that spend to tracked script pubkeys.

diff --git a/docs/.vuepress/public/docs-rs/bdk/nightly/latest/example_bitcoind_rpc_polling/type.ChangeSet.html b/docs/.vuepress/public/docs-rs/bdk/nightly/latest/example_bitcoind_rpc_polling/type.ChangeSet.html index cacf4366b1..c650b3daca 100644 --- a/docs/.vuepress/public/docs-rs/bdk/nightly/latest/example_bitcoind_rpc_polling/type.ChangeSet.html +++ b/docs/.vuepress/public/docs-rs/bdk/nightly/latest/example_bitcoind_rpc_polling/type.ChangeSet.html @@ -1 +1 @@ -ChangeSet in example_bitcoind_rpc_polling - Rust

Type Definition example_bitcoind_rpc_polling::ChangeSet

source ·
pub(crate) type ChangeSet = (ChangeSet, ChangeSet<ConfirmationTimeHeightAnchor, ChangeSet<Keychain>>);
\ No newline at end of file +ChangeSet in example_bitcoind_rpc_polling - Rust
\ No newline at end of file diff --git a/docs/.vuepress/public/docs-rs/bdk/nightly/latest/example_cli/fn.planned_utxos.html b/docs/.vuepress/public/docs-rs/bdk/nightly/latest/example_cli/fn.planned_utxos.html index 2cc794a2bc..99b8f4e627 100644 --- a/docs/.vuepress/public/docs-rs/bdk/nightly/latest/example_cli/fn.planned_utxos.html +++ b/docs/.vuepress/public/docs-rs/bdk/nightly/latest/example_cli/fn.planned_utxos.html @@ -1 +1 @@ -planned_utxos in example_cli - Rust

Function example_cli::planned_utxos

source ·
pub fn planned_utxos<A: Anchor, O: ChainOracle, K: Clone + CanDerive>(
    graph: &KeychainTxGraph<A>,
    chain: &O,
    assets: &Assets<K>
) -> Result<Vec<(Plan<K>, FullTxOut<A>)>, O::Error>
\ No newline at end of file +planned_utxos in example_cli - Rust

Function example_cli::planned_utxos

source ·
pub fn planned_utxos<A: Anchor, O: ChainOracle, K: Clone + CanDerive>(
    graph: &KeychainTxGraph<A>,
    chain: &O,
    assets: &Assets<K>
) -> Result<Vec<(Plan<K>, FullTxOut<A>)>, O::Error>
\ No newline at end of file diff --git a/docs/.vuepress/public/docs-rs/bdk/nightly/latest/example_esplora/type.ChangeSet.html b/docs/.vuepress/public/docs-rs/bdk/nightly/latest/example_esplora/type.ChangeSet.html index a98214f7c6..b687a49edc 100644 --- a/docs/.vuepress/public/docs-rs/bdk/nightly/latest/example_esplora/type.ChangeSet.html +++ b/docs/.vuepress/public/docs-rs/bdk/nightly/latest/example_esplora/type.ChangeSet.html @@ -1 +1 @@ -ChangeSet in example_esplora - Rust

Type Definition example_esplora::ChangeSet

source ·
pub(crate) type ChangeSet = (ChangeSet, ChangeSet<ConfirmationTimeHeightAnchor, ChangeSet<Keychain>>);
\ No newline at end of file +ChangeSet in example_esplora - Rust

Type Definition example_esplora::ChangeSet

source ·
\ No newline at end of file diff --git a/docs/.vuepress/public/docs-rs/bdk/nightly/latest/help.html b/docs/.vuepress/public/docs-rs/bdk/nightly/latest/help.html index 663fe26dfb..20a18d0f8b 100644 --- a/docs/.vuepress/public/docs-rs/bdk/nightly/latest/help.html +++ b/docs/.vuepress/public/docs-rs/bdk/nightly/latest/help.html @@ -1 +1 @@ -Rustdoc help

Rustdoc help

Back
\ No newline at end of file +Rustdoc help

Rustdoc help

Back
\ No newline at end of file diff --git a/docs/.vuepress/public/docs-rs/bdk/nightly/latest/settings.html b/docs/.vuepress/public/docs-rs/bdk/nightly/latest/settings.html index 000377f46d..72fce4ace8 100644 --- a/docs/.vuepress/public/docs-rs/bdk/nightly/latest/settings.html +++ b/docs/.vuepress/public/docs-rs/bdk/nightly/latest/settings.html @@ -1 +1 @@ -Rustdoc settings

Rustdoc settings

Back
\ No newline at end of file +Rustdoc settings

Rustdoc settings

Back
\ No newline at end of file diff --git a/docs/.vuepress/public/docs-rs/bdk/nightly/latest/src/bdk_chain/keychain/txout_index.rs.html b/docs/.vuepress/public/docs-rs/bdk/nightly/latest/src/bdk_chain/keychain/txout_index.rs.html index ece8a6a349..11bcfd5629 100644 --- a/docs/.vuepress/public/docs-rs/bdk/nightly/latest/src/bdk_chain/keychain/txout_index.rs.html +++ b/docs/.vuepress/public/docs-rs/bdk/nightly/latest/src/bdk_chain/keychain/txout_index.rs.html @@ -528,10 +528,6 @@ 528 529 530 -531 -532 -533 -534
use crate::{
     collections::*,
     indexed_tx_graph::Indexer,
@@ -740,9 +736,11 @@
     fn next_store_index(&self, keychain: &K) -> u32 {
         self.inner()
             .all_spks()
-            .range((keychain.clone(), u32::MIN)..(keychain.clone(), u32::MAX))
+            // This range is filtering out the spks with a keychain different than
+            // `keychain`. We don't use filter here as range is more optimized.
+            .range((keychain.clone(), u32::MIN)..(keychain.clone(), u32::MAX))
             .last()
-            .map_or(0, |((_, v), _)| *v + 1)
+            .map_or(0, |((_, index), _)| *index + 1)
     }
 
     /// Generates script pubkey iterators for every `keychain`. The iterators iterate over all
@@ -896,51 +894,45 @@
         let has_wildcard = descriptor.has_wildcard();
 
         let target_index = if has_wildcard { target_index } else { 0 };
-        let next_reveal_index = self.last_revealed.get(keychain).map_or(0, |v| *v + 1);
+        let next_reveal_index = self
+            .last_revealed
+            .get(keychain)
+            .map_or(0, |index| *index + 1);
 
         debug_assert!(next_reveal_index + self.lookahead >= self.next_store_index(keychain));
 
-        // if we need to reveal new indices, the latest revealed index goes here
-        let mut reveal_to_index = None;
-
-        // if the target is not yet revealed, but is already stored (due to lookahead), we need to
-        // set the `reveal_to_index` as target here (as the `for` loop below only updates
-        // `reveal_to_index` for indexes that are NOT stored)
-        if next_reveal_index <= target_index && target_index < next_reveal_index + self.lookahead {
-            reveal_to_index = Some(target_index);
+        // If the target_index is already revealed, we are done
+        if next_reveal_index > target_index {
+            return (
+                SpkIterator::new_with_range(
+                    descriptor.clone(),
+                    next_reveal_index..next_reveal_index,
+                ),
+                super::ChangeSet::default(),
+            );
         }
 
-        // we range over indexes that are not stored
+        // We range over the indexes that are not stored and insert their spks in the index.
+        // Indexes from next_reveal_index to next_reveal_index + lookahead are already stored (due
+        // to lookahead), so we only range from next_reveal_index + lookahead to target + lookahead
         let range = next_reveal_index + self.lookahead..=target_index + self.lookahead;
         for (new_index, new_spk) in SpkIterator::new_with_range(descriptor, range) {
             let _inserted = self
                 .inner
                 .insert_spk((keychain.clone(), new_index), new_spk);
-            debug_assert!(_inserted, "must not have existing spk",);
-
-            // everything after `target_index` is stored for lookahead only
-            if new_index <= target_index {
-                reveal_to_index = Some(new_index);
-            }
+            debug_assert!(_inserted, "must not have existing spk");
+            debug_assert!(
+                has_wildcard || new_index == 0,
+                "non-wildcard descriptors must not iterate past index 0"
+            );
         }
 
-        match reveal_to_index {
-            Some(index) => {
-                let _old_index = self.last_revealed.insert(keychain.clone(), index);
-                debug_assert!(_old_index < Some(index));
-                (
-                    SpkIterator::new_with_range(descriptor.clone(), next_reveal_index..index + 1),
-                    super::ChangeSet(core::iter::once((keychain.clone(), index)).collect()),
-                )
-            }
-            None => (
-                SpkIterator::new_with_range(
-                    descriptor.clone(),
-                    next_reveal_index..next_reveal_index,
-                ),
-                super::ChangeSet::default(),
-            ),
-        }
+        let _old_index = self.last_revealed.insert(keychain.clone(), target_index);
+        debug_assert!(_old_index < Some(target_index));
+        (
+            SpkIterator::new_with_range(descriptor.clone(), next_reveal_index..target_index + 1),
+            super::ChangeSet(core::iter::once((keychain.clone(), target_index)).collect()),
+        )
     }
 
     /// Attempts to reveal the next script pubkey for `keychain`.