-
Notifications
You must be signed in to change notification settings - Fork 130
Conversation
The staticnodes.json file resides in the pantheon data directory, is parsed at startup to determine which peers can be connected to (aside from bootnodes), and is updated whenever addPeer/removePeer RPC is invoked. This file is not updated when finding neighbour peers (ONLY on RPC call).
14047ef
to
08a377c
Compare
@@ -66,7 +67,11 @@ public int size() { | |||
} | |||
|
|||
public boolean isAlreadyConnected(final BytesValue nodeId) { | |||
return connections.containsKey(nodeId); | |||
return getConnectionForPeer(nodeId).isPresent(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why did this need to change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Kinda preferred re-using the same interface as was now exposed ... but have changed it back.
import org.junit.Test; | ||
import org.junit.rules.TemporaryFolder; | ||
|
||
public class StaticeNodesParserTest { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
class name is misnamed. perhaps will be fixed by merge/rebase from master?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
file now removed.
import org.apache.logging.log4j.LogManager; | ||
import org.apache.logging.log4j.Logger; | ||
|
||
public abstract class AdminPeerModification implements JsonRpcMethod { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤔 Something makes me think that AdminModifyPeer would be more consistent. (Noun-verb-noun instead of Noun-Noun-verb?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
RemovePeer Json RPC has been added, it is responsible disconnecting from the specified peer and removing it from the maintained list of peers.