do fragment propagation outside of the pools loop
@@ -85,6 +85,12 @@ impl Pool {
.iter()
.map(move |fragment| FragmentLog::new(fragment.id(), origin))
.collect::<Vec<_>>();
+ self.logs.insert_all(fragment_logs);
+ if count > max_added {
+ max_added = count;
+ }
+ }
+
for fragment in new_fragments.into_iter() {
let fragment_msg = NetworkMsg::Propagate(PropagateMsg::Fragment(fragment));
network_msg_box
@@ -92,11 +98,7 @@ impl Pool {
.await
.map_err(Error::CannotPropagate)?;
}
- self.logs.insert_all(fragment_logs);
- if count > max_added {
- max_added = count;
- }
- }
+
Ok(max_added)
}
