Skip to content

Commit

Permalink
fixed kademlia kbucket add
Browse files Browse the repository at this point in the history
in the kbucket implementation the dontSplit attribute of KBucketNode is typed as bool, but was checked wit "!== undefined" which always was true. This caused KBucket.add to never split the leaf node and therefore kept the kbucket as a single level tree with a maximum of _numberOfNodesPerKBucket entrys in total.
  • Loading branch information
simone1999 committed Aug 14, 2023
1 parent 125a696 commit 0381a4c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/devp2p/src/ext/kbucket.ts
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ export class KBucket {
}

// the bucket is full
if (node.dontSplit !== undefined) {
if (node.dontSplit) {
// we are not allowed to split the bucket
// we need to ping the first this._numberOfNodesToPing
// in order to determine if they are alive
Expand Down

0 comments on commit 0381a4c

Please sign in to comment.