Skip to content

Commit

Permalink
progress
Browse files Browse the repository at this point in the history
  • Loading branch information
aeyakovenko authored and sakridge committed Apr 30, 2018
1 parent 9860e25 commit 2e49ae8
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/crdt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ use packet::SharedBlob;
/// Structure to be replicated by the network
#[derive(Serialize, Deserialize, Clone)]
pub struct ReplicatedData {
id: PublicKey,
pub id: PublicKey,
sig: Signature,
/// should always be increasing
version: u64,
Expand Down
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ pub mod plan;
pub mod recorder;
pub mod result;
pub mod signature;
//pub mod streamer;
pub mod streamer;
pub mod transaction;
extern crate bincode;
extern crate byteorder;
Expand Down
7 changes: 3 additions & 4 deletions src/streamer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ pub fn blob_receiver(

fn recv_window(
window: &mut Vec<Option<SharedBlob>>,
subs: &Arc<RwLock<Crdt>>,
crdt: &Arc<RwLock<Crdt>>,
recycler: &BlobRecycler,
consumed: &mut usize,
r: &BlobReceiver,
Expand All @@ -127,7 +127,6 @@ fn recv_window(
{
//retransmit all leader blocks
let mut retransmitq = VecDeque::new();
let rsubs = subs.read().unwrap();
for b in &dq {
let p = b.read().unwrap();
//TODO this check isn't safe against adverserial packets
Expand All @@ -137,9 +136,9 @@ fn recv_window(
p.get_index().unwrap(),
p.get_id().unwrap(),
p.meta.addr(),
rsubs.leader.addr
leader_id
);
if p.get_id() == Ok(leader_id) {
if p.get_id().unwrap() == leader_id {
//TODO
//need to copy the retransmited blob
//otherwise we get into races with which thread
Expand Down

0 comments on commit 2e49ae8

Please sign in to comment.