Skip to content

Commit

Permalink
Serialize compressed version separately.
Browse files Browse the repository at this point in the history
  • Loading branch information
arik-so committed Apr 26, 2024
1 parent 686c3bc commit a43cfa7
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -324,9 +324,14 @@ async fn serialize_delta<L: Deref + Clone>(network_graph: Arc<NetworkGraph<L>>,

unversioned_output.append(&mut output);
let mut versioned_output = GOSSIP_PREFIX.to_vec();
versioned_output.append(&mut unversioned_output);
versioned_output.append(&mut unversioned_output.clone());

let mut compressed_unversioned_output = rle::encode(&unversioned_output);
{
// sanity check
let recovered_unversioned_output = rle::decode(&compressed_unversioned_output).unwrap();
assert_eq!(unversioned_output, recovered_unversioned_output);
}
let mut compressed_output = [76, 68, 75, 2].to_vec();
compressed_output.append(&mut compressed_unversioned_output);

Expand Down

0 comments on commit a43cfa7

Please sign in to comment.