mirror of
https://github.com/haveno-dex/haveno.git
synced 2025-07-27 00:45:23 -04:00
Use ByteArray for map key, fix auth loops
This commit is contained in:
parent
b827a9812d
commit
1f3c2c1479
14 changed files with 227 additions and 131 deletions
32
common/src/main/java/io/bitsquare/common/ByteArray.java
Normal file
32
common/src/main/java/io/bitsquare/common/ByteArray.java
Normal file
|
@ -0,0 +1,32 @@
|
|||
package io.bitsquare.common;
|
||||
|
||||
import io.bitsquare.app.Version;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Arrays;
|
||||
|
||||
public class ByteArray implements Serializable {
|
||||
// That object is sent over the wire, so we need to take care of version compatibility.
|
||||
private static final long serialVersionUID = Version.NETWORK_PROTOCOL_VERSION;
|
||||
|
||||
public final byte[] bytes;
|
||||
|
||||
public ByteArray(byte[] bytes) {
|
||||
this.bytes = bytes;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (!(o instanceof ByteArray)) return false;
|
||||
|
||||
ByteArray byteArray = (ByteArray) o;
|
||||
|
||||
return Arrays.equals(bytes, byteArray.bytes);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return bytes != null ? Arrays.hashCode(bytes) : 0;
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue