diff --git a/p2p/src/main/java/bisq/network/p2p/storage/P2PDataStorage.java b/p2p/src/main/java/bisq/network/p2p/storage/P2PDataStorage.java index 89fb5cba694..4c07518b524 100644 --- a/p2p/src/main/java/bisq/network/p2p/storage/P2PDataStorage.java +++ b/p2p/src/main/java/bisq/network/p2p/storage/P2PDataStorage.java @@ -82,6 +82,8 @@ import java.time.Clock; +import java.nio.charset.StandardCharsets; + import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; @@ -222,7 +224,7 @@ public GetUpdatedDataRequest buildGetUpdatedDataRequest(NodeAddress senderNodeAd private byte[] getSpecialKey() { byte[] result = new byte[20]; Arrays.fill(result, (byte) 0); - System.arraycopy(Version.VERSION.getBytes(), 0, result, 0, Version.VERSION.length()); + System.arraycopy(Version.VERSION.getBytes(StandardCharsets.UTF_8), 0, result, 0, Version.VERSION.length()); return result; } @@ -234,7 +236,7 @@ private byte[] getSpecialKey() { */ private String findSpecialKey(Set knownPayloadHashes) { return knownPayloadHashes.stream() - .map(byteArray -> new String(byteArray.bytes).trim()) + .map(byteArray -> new String(byteArray.bytes, StandardCharsets.UTF_8).trim()) .filter(s -> s.matches("^[0-9]\\.[0-9]\\.[0-9]$")) .findFirst() .orElse(null);