[bisq-network/bisq] (3/4) [REFACTOR] P2PDataStore::add/remove/refresh (#3557)

Julian Knutsen notifications at github.com
Wed Nov 6 00:36:41 UTC 2019


julianknutsen commented on this pull request.



> -        boolean result = sequenceNrValid &&
-                checkPublicKeys(protectedStorageEntry, true)
-                && checkSignature(protectedStorageEntry);
+        // TODO: Combine with hasSequenceNrIncreased check, but keep existing behavior for now
+        if(!isSequenceNrValid(protectedStorageEntry.getSequenceNumber(), hashOfPayload) ) {
+            log.trace("addProtectedStorageEntry failed due to invalid sequence number");
+
+            return false;
+        }
+
+        // Verify the ProtectedStorageEntry is well formed and valid for the add operation
+        if (!checkPublicKeys(protectedStorageEntry, true) ||
+                !checkSignature(protectedStorageEntry)) {
+
+            log.trace("addProtectedStorageEntry failed due to invalid entry");
+            return false;

The helper methods already have verbose logging and each case will print out a separate message. I updated this PR to only add new messages for the failures that didn't have them before. It is worth another pass to clean these up again, but I don't want to pollute this stack with those changes.

-- 
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/3557#discussion_r342867808
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bisq.network/pipermail/bisq-github/attachments/20191105/57815f22/attachment-0001.html>


More information about the bisq-github mailing list