aboutsummaryrefslogtreecommitdiff
path: root/src/model/block.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/model/block.rs')
-rw-r--r--src/model/block.rs3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/model/block.rs b/src/model/block.rs
index 987ec9e4..a3bbe43d 100644
--- a/src/model/block.rs
+++ b/src/model/block.rs
@@ -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));