Skip to main content

require_sync_budget

Function require_sync_budget 

Source
pub(crate) fn require_sync_budget(
    state: &AppState,
    headers: &HeaderMap,
    peer: Peer,
) -> Result<(), ApiError>
Expand description

Spends one of the caller’s SYNC_READ_LIMIT sync reads, or answers the refusal.

These routes take no credential, so the address is the only caller there is. Checked before the work rather than after, which is the whole point: the cost this bounds is the rebuild, not the response.