[bisq-network/bisq] Add cache for signature verification results and a lookup map by ownerPubKey (#5047)

sqrrm notifications at github.com
Sun Jan 3 13:59:44 CET 2021


@sqrrm approved this pull request.

ACK

> @@ -393,10 +417,15 @@ private boolean verifySignatureWithDSAKey(SignedWitness signedWitness) {
     // witnessOwnerPubKey
     private Set<SignedWitness> getSignedWitnessSetByOwnerPubKey(byte[] ownerPubKey,
                                                                 Stack<P2PDataStorage.ByteArray> excluded) {
-        return getSignedWitnessMapValues().stream()
-                .filter(e -> Arrays.equals(e.getWitnessOwnerPubKey(), ownerPubKey))
-                .filter(e -> !excluded.contains(new P2PDataStorage.ByteArray(e.getSignerPubKey())))
-                .collect(Collectors.toSet());
+        P2PDataStorage.ByteArray key = new P2PDataStorage.ByteArray(ownerPubKey);
+        if (signedWitnessSetByOwnerPubKey.containsKey(key)) {
+            return signedWitnessSetByOwnerPubKey.get(key).stream()
+                    .filter(e -> !excluded.contains(new P2PDataStorage.ByteArray(e.getSignerPubKey())))
+                    .collect(Collectors.toSet());
+

```suggestion
```

-- 
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/5047#pullrequestreview-560692183
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bisq.network/pipermail/bisq-github/attachments/20210103/225244b8/attachment.htm>


More information about the bisq-github mailing list