@@ -34,19 +34,19 @@ pub trait EsploraExt {
3434 request_heights : impl IntoIterator < Item = u32 > ,
3535 ) -> Result < local_chain:: Update , Error > ;
3636
37- /// Scan Esplora for the data specified and return a [`TxGraph`] and a map of last active
38- /// indices.
37+ /// Full scan the keychain scripts specified with the blockchain (via an Esplora client) and
38+ /// returns a [`TxGraph`] and a map of last active indices.
3939 ///
4040 /// * `keychain_spks`: keychains that we want to scan transactions for
4141 /// * `txids`: transactions for which we want updated [`ConfirmationTimeHeightAnchor`]s
4242 /// * `outpoints`: transactions associated with these outpoints (residing, spending) that we
4343 /// want to include in the update
4444 ///
45- /// The scan for each keychain stops after a gap of `stop_gap` script pubkeys with no associated
45+ /// The full scan for each keychain stops after a gap of `stop_gap` script pubkeys with no associated
4646 /// transactions. `parallel_requests` specifies the max number of HTTP requests to make in
4747 /// parallel.
4848 #[ allow( clippy:: result_large_err) ]
49- fn scan_txs_with_keychains < K : Ord + Clone > (
49+ fn full_scan < K : Ord + Clone > (
5050 & self ,
5151 keychain_spks : BTreeMap < K , impl IntoIterator < Item = ( u32 , ScriptBuf ) > > ,
5252 txids : impl IntoIterator < Item = Txid > ,
@@ -55,18 +55,31 @@ pub trait EsploraExt {
5555 parallel_requests : usize ,
5656 ) -> Result < ( TxGraph < ConfirmationTimeHeightAnchor > , BTreeMap < K , u32 > ) , Error > ;
5757
58- /// Convenience method to call [`scan_txs_with_keychains`] without requiring a keychain.
58+ /// Sync a set of scripts with with the blockchain (via an Esplora client) for the data
59+ /// specified and return a [`TxGraph`] and a map of last active indices.
60+ ///
61+ /// * `misc_spks`: scripts that we want to sync transactions for
62+ /// * `txids`: transactions for which we want updated [`ConfirmationTimeHeightAnchor`]s
63+ /// * `outpoints`: transactions associated with these outpoints (residing, spending) that we
64+ /// want to include in the update
65+ ///
66+ /// The scan for each keychain stops after a gap of `stop_gap` script pubkeys with no associated
67+ /// transactions. `parallel_requests` specifies the max number of HTTP requests to make in
68+ /// parallel.
69+ ///
70+ /// If the scripts to sync are unknown, such as when restoring or importing a keychain that
71+ /// may include scripts that have been used, use [`full_scan`] with the keychain.
5972 ///
60- /// [`scan_txs_with_keychains `]: EsploraExt::scan_txs_with_keychains
73+ /// [`full_scan `]: EsploraExt::full_scan
6174 #[ allow( clippy:: result_large_err) ]
62- fn scan_txs (
75+ fn sync (
6376 & self ,
6477 misc_spks : impl IntoIterator < Item = ScriptBuf > ,
6578 txids : impl IntoIterator < Item = Txid > ,
6679 outpoints : impl IntoIterator < Item = OutPoint > ,
6780 parallel_requests : usize ,
6881 ) -> Result < TxGraph < ConfirmationTimeHeightAnchor > , Error > {
69- self . scan_txs_with_keychains (
82+ self . full_scan (
7083 [ (
7184 ( ) ,
7285 misc_spks
@@ -190,7 +203,7 @@ impl EsploraExt for esplora_client::BlockingClient {
190203 } )
191204 }
192205
193- fn scan_txs_with_keychains < K : Ord + Clone > (
206+ fn full_scan < K : Ord + Clone > (
194207 & self ,
195208 keychain_spks : BTreeMap < K , impl IntoIterator < Item = ( u32 , ScriptBuf ) > > ,
196209 txids : impl IntoIterator < Item = Txid > ,
0 commit comments