[bisq-network/bisq] Reduce initial request size (#4233)

sqrrm notifications at github.com
Thu May 21 13:01:30 UTC 2020


@sqrrm commented on this pull request.



> @@ -205,24 +213,47 @@ public GetUpdatedDataRequest buildGetUpdatedDataRequest(NodeAddress senderNodeAd
         return new GetUpdatedDataRequest(senderNodeAddress, nonce, this.getKnownPayloadHashes());
     }
 
+    private byte[] getSpecialKey() {
+        byte[] result = new byte[20];
+        Arrays.fill(result, (byte) 0);
+        System.arraycopy(Version.VERSION.getBytes(), 0, result, 0, Version.VERSION.length());
+        return result;
+    }
+
+    private String containsSpecialKey(Set<P2PDataStorage.ByteArray> collection) {
+        Optional<String> result = collection.stream().map(byteArray -> new String(byteArray.bytes).trim()).filter(s -> s.matches("^[0-9]\\.[0-9]\\.[0-9]$")).findFirst();

I ask since it might act differently on different platforms. I think it would never be an issue for version values, but perhaps other values could cause problems, deterministic is nice.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/bisq-network/bisq/pull/4233#discussion_r428636349
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bisq.network/pipermail/bisq-github/attachments/20200521/2da0f97d/attachment.html>


More information about the bisq-github mailing list