Skip to main content

finalized_scan_limit

Function finalized_scan_limit 

Source
fn finalized_scan_limit(max_entries: usize, chain_spent_count: usize) -> usize
Expand description

The number of UTXOs a limited finalized query has to ask for, when the caller wants max_entries of them and the non-finalized chain spends chain_spent_count of the addresses’ UTXOs.

Any of the UTXOs the finalized query returns can turn out to be spent by the chain, so the query has to over-fetch by as many entries as the chain spends. Otherwise a full page comes back short, and a caller paging by count reads that as the end of the addresses’ UTXOs.

The result is an over-approximation: it can make the query read entries that are then discarded, but never too few to fill the page.