Skip to main content

scan_block

Function scan_block 

Source
pub fn scan_block<P, AccountId, IvkTag, E>(
    params: &P,
    height: BlockHeight,
    header: &BlockHeader,
    vtx: Vec<BatchResult<IvkTag>>,
    scanning_keys: &ScanningKeys<AccountId, IvkTag>,
    spend_ids: &SpendIdentifiers<AccountId>,
    prior_block_metadata: Option<&BlockMetadata>,
    find_account_for_address: impl Fn(&TransparentAddress) -> Result<Option<(AccountId, Option<TransparentKeyScope>)>, E>,
) -> Result<ScannedBlock<AccountId>, ScanBlockError<E>>
where P: Parameters + Send + 'static, AccountId: Default + Debug + Ord + Hash + ConditionallySelectable + Send + Sync + 'static, IvkTag: Copy + Hash + Eq + Send + 'static,
Expand description

Scans a block with a set of ScanningKeys.

Returns a ScannedBlock containing one WalletTx for each transaction in the block that is decryptable by any of the given keys. If an output is decrypted by a full viewing key, the nullifiers of that output will also be computed.

This is the second half of block scanning. Use decrypt_block, or the sync::decryptor engine (available behind the sync-decryptor feature flag), for the first half.

ยงPanics

Panics if any of the BatchResults in vtx references an IvkTag not present in scanning_keys. To uphold this precondition, use the same set of ScanningKeys with both this function and decrypt_block (or sync::decryptor::new if you are running the decryption engine yourself).