aboutsummaryrefslogtreecommitdiffstats
path: root/src/transport
diff options
context:
space:
mode:
Diffstat (limited to 'src/transport')
-rw-r--r--src/transport/mod.rs4
-rw-r--r--src/transport/wire.rs3
2 files changed, 5 insertions, 2 deletions
diff --git a/src/transport/mod.rs b/src/transport/mod.rs
index 2778ed7..e366f72 100644
--- a/src/transport/mod.rs
+++ b/src/transport/mod.rs
@@ -488,7 +488,8 @@ pub(crate) struct TreeLink {
/// NEIGHBOUR: the sender asks the recipient to be neighbours (`swarm::hyparview`), as
/// HyParView's NEIGHBOR; `high` when the sender has none (then the recipient makes room
-/// if it must).
+/// if it must), `one_short` when it has one less than `k` (then a recipient with `k`
+/// takes it as its `k + 1`th).
#[derive(Debug, Clone, Serialize, Deserialize)]
pub(crate) struct NeighbourRequest {
#[serde(with = "crate::transport::wire::codec::epoch")]
@@ -496,6 +497,7 @@ pub(crate) struct NeighbourRequest {
/// See `SyncEnvelope::epoch_seq`.
pub(crate) epoch_seq: u32,
pub(crate) high: bool,
+ pub(crate) one_short: bool,
}
/// NEIGHBOUR_REPLY (whether the recipient of a NEIGHBOUR agreed) and DISCONNECT (never
diff --git a/src/transport/wire.rs b/src/transport/wire.rs
index 3b67a74..c0db2e2 100644
--- a/src/transport/wire.rs
+++ b/src/transport/wire.rs
@@ -14,7 +14,7 @@ use super::{EncodedMessage, MessageKind, ParsedMessage};
/// The wire format's version, the first byte of every payload. Bump it with every change
/// to a message type or a codec (`golden_bytes` fails then).
-pub(crate) const VERSION: u8 = 49;
+pub(crate) const VERSION: u8 = 50;
/// What the second byte of a payload says.
fn tag(kind: MessageKind) -> u8 {
@@ -534,6 +534,7 @@ pub(crate) fn samples() -> Vec<ParsedMessage> {
epoch,
epoch_seq: 1,
high: true,
+ one_short: false,
}),
ParsedMessage::NeighbourReply(crate::transport::NeighbourAnswer {
epoch,