pub fn scan_cached_blocks<ParamsT, DbT, BlockSourceT>(
params: &ParamsT,
block_source: &BlockSourceT,
data_db: &mut DbT,
from_height: BlockHeight,
from_state: &ChainState,
limit: usize,
) -> Result<ScanSummary, Error<<DbT as WalletRead>::Error, BlockSourceT::Error>>where
ParamsT: Parameters + Send + 'static,
BlockSourceT: BlockSource,
DbT: WalletWrite,
<DbT as WalletRead>::AccountId: ConditionallySelectable + Default + Send + Sync + 'static,Expand description
Scans at most limit blocks from the provided block source in order to find transactions
received by the accounts tracked in the provided wallet database.
This function will return after scanning at most limit new blocks, to enable the caller to
update their UI with scanning progress.
§Errors
Error::BlockSourceif the requested blocks cannot be read fromblock_source.Error::Scanif a scanned block violates chain-continuity rules or contains note commitments that cannot be reconciled with the wallet’s note commitment tree(s).Error::Walletif a wallet-database operation fails. This covers reading the tracked viewing keys, block metadata, and nullifiers, as well as persisting the scanned blocks viaWalletWrite::put_blocks. In particular, a failure to update the note commitment trees with the scanned data is reported here (for example, thezcash_client_sqlitebackend surfaces such a failure as aPutBlocksCommitmentTreeerror identifying the affected shielded pool and block range).
§Panics
This method will panic if from_height != from_state.block_height() + 1.