aboutsummaryrefslogtreecommitdiff
path: root/p2p/src/routing_table/entry.rs
diff options
context:
space:
mode:
Diffstat (limited to 'p2p/src/routing_table/entry.rs')
-rw-r--r--p2p/src/routing_table/entry.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/p2p/src/routing_table/entry.rs b/p2p/src/routing_table/entry.rs
index 3fc8a6b..1427c2b 100644
--- a/p2p/src/routing_table/entry.rs
+++ b/p2p/src/routing_table/entry.rs
@@ -5,6 +5,9 @@ use karyon_net::{Addr, Port};
/// Specifies the size of the key, in bytes.
pub const KEY_SIZE: usize = 32;
+/// The unique key identifying the peer.
+pub type Key = [u8; KEY_SIZE];
+
/// An Entry represents a peer in the routing table.
#[derive(Encode, Decode, Clone, Debug)]
pub struct Entry {
@@ -20,14 +23,11 @@ pub struct Entry {
impl PartialEq for Entry {
fn eq(&self, other: &Self) -> bool {
- // TODO: this should also compare both addresses (the self.addr == other.addr)
+ // XXX: should we compare both self.addr and other.addr???
self.key == other.key
}
}
-/// The unique key identifying the peer.
-pub type Key = [u8; KEY_SIZE];
-
/// Calculates the XOR distance between two provided keys.
///
/// The XOR distance is a metric used in Kademlia to measure the closeness