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 if the scanned note commitment data (orfrom_state) conflicts with the wallet’s note commitment tree(s). The latter is reported byWalletWrite::put_blocksasPutBlocksError::Continuityand is a continuity error at the first block of the batch.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.
§Panics
This method will panic if from_height != from_state.block_height() + 1.