[bisq-network/bisq] Add protection tools (#2787)

Christoph Atteneder notifications at github.com
Tue Apr 30 11:31:26 UTC 2019


ripcurlx commented on this pull request.



> +    // witnessOwnerPubKey
+    public Set<SignedWitness> getSignedWitnessSetBySignerPubKey(byte[] signerPubKey) {
+        return signedWitnessMap.values().stream()
+                .filter(e -> Arrays.equals(e.getWitnessOwnerPubKey(), signerPubKey))
+                .collect(Collectors.toSet());
+    }
+
+    //TODO pass list and remove items once processed to avoid endless loop in case of multiple sigs
+    public boolean isValidAccountAgeWitness(AccountAgeWitness accountAgeWitness) {
+        Set<SignedWitness> arbitratorsSignedWitnessSet = getArbitratorsSignedWitnessSet(accountAgeWitness);
+        if (!arbitratorsSignedWitnessSet.isEmpty()) {
+            // Our peer was signed by arbitrator. We only check it at least one is valid and don't need to go further.
+            return arbitratorsSignedWitnessSet.stream().anyMatch(this::verify);
+        } else {
+            Set<SignedWitness> trustedPeerSignedWitnessSet = getTrustedPeerSignedWitnessSet(accountAgeWitness);
+            // We have some SignedWitness singed by any trusted peer and need to see if it is valid and has a

typo `singed` should be `signed`

-- 
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/2787#pullrequestreview-232117876
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bisq.network/pipermail/bisq-github/attachments/20190430/6b731eb0/attachment.html>


More information about the bisq-github mailing list