diff --git a/src/main/java/org/qortal/api/model/ConnectedPeer.java b/src/main/java/org/qortal/api/model/ConnectedPeer.java index c41986541..d3001fcb4 100644 --- a/src/main/java/org/qortal/api/model/ConnectedPeer.java +++ b/src/main/java/org/qortal/api/model/ConnectedPeer.java @@ -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; @@ -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()); diff --git a/src/main/java/org/qortal/api/model/NodeInfo.java b/src/main/java/org/qortal/api/model/NodeInfo.java index 6732357ac..08ecf87c9 100644 --- a/src/main/java/org/qortal/api/model/NodeInfo.java +++ b/src/main/java/org/qortal/api/model/NodeInfo.java @@ -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; diff --git a/src/main/java/org/qortal/api/restricted/resource/AdminResource.java b/src/main/java/org/qortal/api/restricted/resource/AdminResource.java index 837288e56..3536d1446 100644 --- a/src/main/java/org/qortal/api/restricted/resource/AdminResource.java +++ b/src/main/java/org/qortal/api/restricted/resource/AdminResource.java @@ -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(); diff --git a/src/main/java/org/qortal/crypto/Crypto.java b/src/main/java/org/qortal/crypto/Crypto.java index 3beb7abdc..83f434bb7 100644 --- a/src/main/java/org/qortal/crypto/Crypto.java +++ b/src/main/java/org/qortal/crypto/Crypto.java @@ -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. @@ -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); } diff --git a/src/main/java/org/qortal/network/Handshake.java b/src/main/java/org/qortal/network/Handshake.java index 221e5e740..7935a349f 100644 --- a/src/main/java/org/qortal/network/Handshake.java +++ b/src/main/java/org/qortal/network/Handshake.java @@ -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; diff --git a/src/main/java/org/qortal/network/Network.java b/src/main/java/org/qortal/network/Network.java index b42ab450a..114cdcb1f 100644 --- a/src/main/java/org/qortal/network/Network.java +++ b/src/main/java/org/qortal/network/Network.java @@ -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; @@ -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(); } diff --git a/src/main/java/org/qortal/network/Peer.java b/src/main/java/org/qortal/network/Peer.java index 821f368ce..e32df5433 100644 --- a/src/main/java/org/qortal/network/Peer.java +++ b/src/main/java/org/qortal/network/Peer.java @@ -124,7 +124,6 @@ public class Peer { private final Object peerInfoLock = new Object(); - private String peersNodeId; private byte[] peersPublicKey; private byte[] peersChallenge; @@ -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;