More security: don't delete stuff too easily

This commit is contained in:
Alex Auvolat
2021-03-11 19:06:27 +01:00
parent f7c2cd1cd7
commit 3f7a496355
3 changed files with 12 additions and 1 deletions
+3
View File
@@ -305,6 +305,9 @@ impl BlockManager {
let ring = self.system.ring.borrow().clone();
let mut who = self.replication.replication_nodes(&hash, &ring);
if who.len() < self.replication.write_quorum(&self.system) {
return Err(Error::Message(format!("Not trying to offload block because we don't have a quorum of nodes to write to")));
}
who.retain(|id| *id != self.system.id);
let msg = Arc::new(Message::NeedBlockQuery(*hash));