mirror of
https://seed.radicle.dev/rad:z3gqcJUoA1n9HaHKufZs5FCSGazv5.git
synced 2026-11-16 08:10:40 +08:00
node: Implement binary encoding for messages
Signed-off-by: Alexis Sellier <self@cloudhead.io>
This commit is contained in:
+11
-4
@@ -2,6 +2,7 @@
|
||||
pub mod config;
|
||||
pub mod message;
|
||||
pub mod peer;
|
||||
pub mod wire;
|
||||
|
||||
use std::ops::{Deref, DerefMut};
|
||||
use std::{collections::VecDeque, fmt, io, net, net::IpAddr};
|
||||
@@ -667,6 +668,16 @@ pub struct Context<S, T, G> {
|
||||
rng: Rng,
|
||||
}
|
||||
|
||||
impl<S, T, G> Context<S, T, G>
|
||||
where
|
||||
T: storage::ReadStorage,
|
||||
G: crypto::Signer,
|
||||
{
|
||||
pub(crate) fn id(&self) -> NodeId {
|
||||
*self.signer.public_key()
|
||||
}
|
||||
}
|
||||
|
||||
impl<'r, S, T, G> Context<S, T, G>
|
||||
where
|
||||
T: storage::WriteStorage<'r>,
|
||||
@@ -692,10 +703,6 @@ where
|
||||
}
|
||||
}
|
||||
|
||||
pub(crate) fn id(&self) -> NodeId {
|
||||
*self.signer.public_key()
|
||||
}
|
||||
|
||||
/// Process a peer inventory announcement by updating our routing table.
|
||||
fn process_inventory(&mut self, inventory: &Inventory, from: NodeId, remote: &Url) {
|
||||
for proj_id in inventory {
|
||||
|
||||
Reference in New Issue
Block a user