mirror of
https://github.com/ChronosX88/KademliaDHT.git
synced 2024-11-25 03:32:19 +00:00
Fixed the bug that was causing the problem when adding the local node to the routing table when the routing table is created.
- The problem was that we were creating the RoutingTable before the Node initialization was finished, which was causing some problems since the RoutingTable needs the NodeId which is not available until after the Node initialization
This commit is contained in:
parent
3f82c4a0ef
commit
104f20775f
@ -26,17 +26,13 @@ public class Node implements Streamable
|
||||
|
||||
private transient RoutingTable routingTable;
|
||||
|
||||
|
||||
{
|
||||
this.routingTable = new RoutingTable(this);
|
||||
}
|
||||
|
||||
public Node(NodeId nid, InetAddress ip, int port)
|
||||
{
|
||||
this.nodeId = nid;
|
||||
this.inetAddress = ip;
|
||||
this.port = port;
|
||||
this.strRep = this.nodeId.toString();
|
||||
this.routingTable = new RoutingTable(this);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -32,8 +32,8 @@ public class RoutingTable
|
||||
/* Initialize all of the buckets to a specific depth */
|
||||
this.initialize();
|
||||
|
||||
/* @todo Insert the local node */
|
||||
//this.insert(localNode);
|
||||
/* Insert the local node */
|
||||
this.insert(localNode);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user