Skip to content

Commit

Permalink
docs(electrum): fixed full_scan, sync, and crate documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
LagginTimes authored and evanlinjin committed May 10, 2024
1 parent b1f861b commit 9ed33c2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 11 deletions.
14 changes: 4 additions & 10 deletions crates/electrum/src/electrum_ext.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,8 @@ pub trait ElectrumExt {
/// Full scan the keychain scripts specified with the blockchain (via an Electrum client) and
/// returns updates for [`bdk_chain`] data structures.
///
/// - `prev_tip`: the most recent blockchain tip present locally
/// - `keychain_spks`: keychains that we want to scan transactions for
/// - `full_txs`: [`TxGraph`] that contains all previously known transactions
/// - `request`: struct with data required to perform a spk-based blockchain client full scan,
/// see [`FullScanRequest`]
///
/// The full scan for each keychain stops after a gap of `stop_gap` script pubkeys with no associated
/// transactions. `batch_size` specifies the max number of script pubkeys to request for in a
Expand All @@ -35,12 +34,8 @@ pub trait ElectrumExt {
/// Sync a set of scripts with the blockchain (via an Electrum client) for the data specified
/// and returns updates for [`bdk_chain`] data structures.
///
/// - `prev_tip`: the most recent blockchain tip present locally
/// - `misc_spks`: an iterator of scripts we want to sync transactions for
/// - `full_txs`: [`TxGraph`] that contains all previously known transactions
/// - `txids`: transactions for which we want updated [`bdk_chain::Anchor`]s
/// - `outpoints`: transactions associated with these outpoints (residing, spending) that we
/// want to include in the update
/// - `request`: struct with data required to perform a spk-based blockchain client sync,
/// see [`SyncRequest`]
///
/// `batch_size` specifies the max number of script pubkeys to request for in a single batch
/// request.
Expand Down Expand Up @@ -450,7 +445,6 @@ fn populate_with_txids(
};

if graph_update.get_tx(txid).is_none() {
// TODO: We need to be able to insert an `Arc` of a transaction.
let _ = graph_update.insert_tx(tx);
}
if let Some(anchor) = anchor {
Expand Down
2 changes: 1 addition & 1 deletion crates/electrum/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
//! keychain where the range of possibly used scripts is not known. In this case it is necessary to
//! scan all keychain scripts until a number (the "stop gap") of unused scripts is discovered. For a
//! sync or full scan the user receives relevant blockchain data and output updates for
//! [`bdk_chain`] including [`bdk_chain::TxGraph`], which includes `txid`s and full transactions.
//! [`bdk_chain`].
//!
//! Refer to [`example_electrum`] for a complete example.
//!
Expand Down

0 comments on commit 9ed33c2

Please sign in to comment.