aboutsummaryrefslogtreecommitdiffstats
path: root/src/remake/mod.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/remake/mod.rs')
-rw-r--r--src/remake/mod.rs17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/remake/mod.rs b/src/remake/mod.rs
index 342eab3..840322a 100644
--- a/src/remake/mod.rs
+++ b/src/remake/mod.rs
@@ -39,6 +39,23 @@ mod vote;
#[cfg(test)]
pub(crate) use api::testing;
+
+/// Quarantines `paths` of `document` (of `epoch`): this node's writes on a change the
+/// swarm's rules refuse, which it took unjudged and has dropped since
+/// (`AppState::drop_taken`). The quarantine's id, if any.
+pub(crate) fn quarantine_taken<H: Host>(
+ host: &H,
+ epoch: crate::document::replica::Epoch,
+ document: &crate::document::Document,
+ paths: Vec<Vec<String>>,
+) -> Option<String> {
+ let reason = "written on a change the swarm's rules refuse, which this node took unjudged";
+ let quarantined = paths
+ .into_iter()
+ .map(|path| (path, reason.to_owned()))
+ .collect();
+ quarantine::add(host, epoch, epoch, document, quarantined)
+}
pub(crate) use delta::Superseded;
pub(crate) use kind::remake_genesis;
pub(crate) use local::RemakeState;