From 77e9bf7c43d025615cd48d6e3c464fc824e1ce2c Mon Sep 17 00:00:00 2001
From: m2049r <m2049r@monerujo.io>
Date: Fri, 12 Mar 2021 14:31:10 +0100
Subject: [PATCH] fix Node equality

---
 app/src/main/java/com/m2049r/xmrwallet/data/Node.java | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/app/src/main/java/com/m2049r/xmrwallet/data/Node.java b/app/src/main/java/com/m2049r/xmrwallet/data/Node.java
index 133c49c5..65011e1c 100644
--- a/app/src/main/java/com/m2049r/xmrwallet/data/Node.java
+++ b/app/src/main/java/com/m2049r/xmrwallet/data/Node.java
@@ -64,12 +64,14 @@ public class Node {
         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
     public boolean equals(Object other) {
         if (!(other instanceof Node)) return false;
         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) {