aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Schanzenbach <schanzen@gnunet.org>2021-12-10 09:36:56 +0100
committerMartin Schanzenbach <schanzen@gnunet.org>2021-12-10 09:36:56 +0100
commit8e94bfad642ed73732f052a9fb51892fb32fa2e3 (patch)
treef71668b69b6cc57d69fd65f15365325d709ffb99
parent74fffdf71d7eaba596815da100ef4fe7d8ef0946 (diff)
downloadgnunet-8e94bfad642ed73732f052a9fb51892fb32fa2e3.tar.gz
gnunet-8e94bfad642ed73732f052a9fb51892fb32fa2e3.zip
- fix closest peer algorithm
-rw-r--r--src/dht/gnunet-service-dht_neighbours.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/dht/gnunet-service-dht_neighbours.c b/src/dht/gnunet-service-dht_neighbours.c
index 02dab849b..fb061d5b1 100644
--- a/src/dht/gnunet-service-dht_neighbours.c
+++ b/src/dht/gnunet-service-dht_neighbours.c
@@ -963,8 +963,6 @@ GDS_am_closest_peer (const struct GNUNET_HashCode *key,
963 key); 963 key);
964 if (other_bits > bits) 964 if (other_bits > bits)
965 return GNUNET_NO; 965 return GNUNET_NO;
966 if (other_bits == bits) /* We match the same number of bits */
967 return GNUNET_YES;
968 pos = pos->next; 966 pos = pos->next;
969 } 967 }
970 /* No peers closer, we are the closest! */ 968 /* No peers closer, we are the closest! */
@@ -1924,6 +1922,7 @@ handle_find_peer (const struct GNUNET_PeerIdentity *sender,
1924 } 1922 }
1925 1923
1926 /* then, also consider sending a random HELLO from the closest bucket */ 1924 /* then, also consider sending a random HELLO from the closest bucket */
1925 /* FIXME: How can this be true? Shouldnt we just do find_bucket() ? */
1927 if (0 == memcmp (&my_identity_hash, 1926 if (0 == memcmp (&my_identity_hash,
1928 key, 1927 key,
1929 sizeof(struct GNUNET_HashCode))) 1928 sizeof(struct GNUNET_HashCode)))