Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove nodeId #168

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions src/main/java/org/qortal/api/model/ConnectedPeer.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@ public enum Direction {
public String address;
public String version;

public String nodeId;

public Integer lastHeight;
@Schema(example = "base58")
public byte[] lastBlockSignature;
Expand All @@ -54,7 +52,6 @@ public ConnectedPeer(Peer peer) {
this.address = peerData.getAddress().toString();

this.version = peer.getPeersVersionString();
this.nodeId = peer.getPeersNodeId();
this.connectionId = peer.getPeerConnectionId();
if (peer.getConnectionEstablishedTime() > 0) {
long age = (System.currentTimeMillis() - peer.getConnectionEstablishedTime());
Expand Down
1 change: 0 additions & 1 deletion src/main/java/org/qortal/api/model/NodeInfo.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ public class NodeInfo {
public long uptime;
public String buildVersion;
public long buildTimestamp;
public String nodeId;
public boolean isTestNet;
public String type;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,6 @@ public NodeInfo info() {
nodeInfo.uptime = System.currentTimeMillis() - Controller.startTime;
nodeInfo.buildVersion = Controller.getInstance().getVersionString();
nodeInfo.buildTimestamp = Controller.getInstance().getBuildTimestamp();
nodeInfo.nodeId = Network.getInstance().getOurNodeId();
nodeInfo.isTestNet = Settings.getInstance().isTestNet();
nodeInfo.type = getNodeType();

Expand Down
5 changes: 0 additions & 5 deletions src/main/java/org/qortal/crypto/Crypto.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ public abstract class Crypto {

public static final byte ADDRESS_VERSION = 58; // Q
public static final byte AT_ADDRESS_VERSION = 23; // A
public static final byte NODE_ADDRESS_VERSION = 53; // N

/**
* Returns 32-byte SHA-256 digest of message passed in input.
Expand Down Expand Up @@ -202,10 +201,6 @@ public static String toATAddress(byte[] signature) {
return toAddress(AT_ADDRESS_VERSION, signature);
}

public static String toNodeAddress(byte[] publicKey) {
return toAddress(NODE_ADDRESS_VERSION, publicKey);
}

public static boolean isValidAddress(String address) {
return isValidTypedAddress(address, ADDRESS_VERSION, AT_ADDRESS_VERSION);
}
Expand Down
2 changes: 0 additions & 2 deletions src/main/java/org/qortal/network/Handshake.java
Original file line number Diff line number Diff line change
Expand Up @@ -182,8 +182,6 @@ public Handshake onMessage(Peer peer, Message message) {
return null;
}

peer.setPeersNodeId(Crypto.toNodeAddress(peersPublicKey));

// For inbound peers, we need to go into interim holding state while we compute RESPONSE
if (!peer.isOutbound())
return RESPONDING;
Expand Down
7 changes: 1 addition & 6 deletions src/main/java/org/qortal/network/Network.java
Original file line number Diff line number Diff line change
Expand Up @@ -92,10 +92,9 @@ public class Network {

private static final int BROADCAST_CHAIN_TIP_DEPTH = 7; // Just enough to fill a SINGLE TCP packet (~1440 bytes)

// Generate our node keys / ID
// Generate our node keys
private final Ed25519PrivateKeyParameters edPrivateKeyParams = new Ed25519PrivateKeyParameters(new SecureRandom());
private final Ed25519PublicKeyParameters edPublicKeyParams = edPrivateKeyParams.generatePublicKey();
private final String ourNodeId = Crypto.toNodeAddress(edPublicKeyParams.getEncoded());

private final int maxMessageSize;
private final int minOutboundPeers;
Expand Down Expand Up @@ -281,10 +280,6 @@ public byte[] getMessageMagic() {
return Settings.getInstance().isTestNet() ? TESTNET_MESSAGE_MAGIC : MAINNET_MESSAGE_MAGIC;
}

public String getOurNodeId() {
return this.ourNodeId;
}

protected byte[] getOurPublicKey() {
return this.edPublicKeyParams.getEncoded();
}
Expand Down
13 changes: 0 additions & 13 deletions src/main/java/org/qortal/network/Peer.java
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,6 @@ public class Peer {

private final Object peerInfoLock = new Object();

private String peersNodeId;
private byte[] peersPublicKey;
private byte[] peersChallenge;

Expand Down Expand Up @@ -321,18 +320,6 @@ protected byte[] getOurChallenge() {
return this.ourChallenge;
}

public String getPeersNodeId() {
synchronized (this.peerInfoLock) {
return this.peersNodeId;
}
}

protected void setPeersNodeId(String peersNodeId) {
synchronized (this.peerInfoLock) {
this.peersNodeId = peersNodeId;
}
}

public byte[] getPeersPublicKey() {
synchronized (this.peerInfoLock) {
return this.peersPublicKey;
Expand Down
Loading