1
mirror of https://github.com/m2049r/xmrwallet synced 2025-04-15 11:41:13 +02:00

fix Node equality

This commit is contained in:
m2049r 2021-03-12 14:31:10 +01:00 committed by m2049r
parent 40f5c9365e
commit 77e9bf7c43

@ -64,12 +64,14 @@ public class Node {
return hostAddress.hashCode(); return hostAddress.hashCode();
} }
// Nodes are equal if they are the same host address & are on the same network // Nodes are equal if they are the same host address:port & are on the same network
@Override @Override
public boolean equals(Object other) { public boolean equals(Object other) {
if (!(other instanceof Node)) return false; if (!(other instanceof Node)) return false;
final Node anotherNode = (Node) other; final Node anotherNode = (Node) other;
return (hostAddress.equals(anotherNode.hostAddress) && (networkType == anotherNode.networkType)); return (hostAddress.equals(anotherNode.hostAddress)
&& (rpcPort == anotherNode.rpcPort)
&& (networkType == anotherNode.networkType));
} }
static public Node fromString(String nodeString) { static public Node fromString(String nodeString) {