Erasure refinements, fix generating orders table

This commit is contained in:
Stephen Akridge
2018-05-28 10:25:15 -07:00
committed by Greg Fitzgerald
parent 93b6fceb2f
commit d053f78b74
3 changed files with 153 additions and 91 deletions

View File

@@ -378,6 +378,11 @@ fn broadcast(
}
let mut blobs = dq.into_iter().collect();
// Insert the coding blobs into the blob stream
#[cfg(feature = "erasure")]
erasure::add_coding_blobs(recycler, &mut blobs, *transmit_index);
// Index the blobs
Crdt::index_blobs(crdt, &blobs, transmit_index)?;
// keep the cache of blobs that are broadcast
{
@@ -406,15 +411,16 @@ fn broadcast(
}
}
// appends codes to the list of blobs allowing us to reconstruct the stream
// Fill in the coding blob data from the window data blobs
#[cfg(feature = "erasure")]
{
match erasure::generate_coding(recycler, &mut window.write().unwrap(), *transmit_index as usize) {
Err(_e) => { return Err(Error::GenericError) }
match erasure::generate_coding(&mut window.write().unwrap(), *transmit_index as usize) {
Err(_e) => return Err(Error::GenericError),
_ => {}
}
}
// Send blobs out from the window
Crdt::broadcast(crdt, &window, &sock, transmit_index)?;
Ok(())
}