This commit is contained in:
John Smith
2023-03-01 15:50:30 -05:00
parent 615158d54e
commit 562f9bb7f7
36 changed files with 943 additions and 784 deletions

View File

@@ -127,7 +127,7 @@ impl RoutingTableUnlockedInner {
pub fn node_id_typed_key_pairs(&self) -> Vec<TypedKeyPair> {
let mut tkps = Vec::new();
for (ck, v) in &self.node_id_keypairs {
tkps.push(TypedKeyPair::new(*ck, v.key, v.secret));
tkps.push(TypedKeyPair::new(*ck, *v));
}
tkps
}
@@ -139,7 +139,7 @@ impl RoutingTableUnlockedInner {
pub fn matches_own_node_id(&self, node_ids: &[TypedKey]) -> bool {
for ni in node_ids {
if let Some(v) = self.node_id_keypairs.get(&ni.kind) {
if v.key == ni.key {
if v.key == ni.value {
return true;
}
}
@@ -163,7 +163,7 @@ impl RoutingTableUnlockedInner {
(
node_id.kind,
vcrypto
.distance(&node_id.key, &self_node_id)
.distance(&node_id.value, &self_node_id)
.first_nonzero_bit()
.unwrap(),
)