Skip to main content

remove_unkept

Function remove_unkept 

Source
pub fn remove_unkept(
    library: &mut Library,
    network: &Network,
    records: &Records,
    found: &BTreeSet<[u8; 32]>,
    now: &dyn Fn() -> u64,
    rng: &mut impl CryptoRng,
) -> Result<RemovalPass, NodeError>
Expand description

Removes, a little at a time, the copies that this replica no longer keeps, once other disks have proven theirs (technical design: the planner): plans a pass (Library::plan_removals) among the replicas whose endpoints were found on the network, syncs with each that is to prove its copies, one after the other, putting the challenges to it, and removes the copies whose proofs came in time (Library::remove_proven), marked in records while they go; then purges the thumbnails that it made twice (Library::purge_thumbnails_made_twice). First, it destroys what purges destroyed whose wait has ended (Library::destroy_due).

ยงErrors

Returns an error if the library cannot be read, the records cannot be written, or a copy cannot be removed; a sync that fails is in the result, and the copies it was to prove stay.