Implementing equals and hashcode in PublicKey class

This commit is contained in:
Nelson R. Perez 2016-12-18 17:20:05 -05:00
parent 5fa4d8667f
commit 4e2601e80f

View file

@ -39,4 +39,15 @@ public class PublicKey implements ByteSerializable {
}
return new Address(pk).toString();
}
@Override
public int hashCode() {
return publicKey.hashCode();
}
@Override
public boolean equals(Object obj) {
PublicKey other = (PublicKey) obj;
return this.publicKey.equals(other.getKey());
}
}