[bisq-network/bisq] Sign account usage (#2768)

Manfred Karrer notifications at github.com
Tue Apr 23 18:17:59 UTC 2019


ManfredKarrer commented on this pull request.



> +    public Set<SignedWitness> getTrustedPeerSignedWitnessSet(AccountAgeWitness accountAgeWitness) {
+        return signedWitnessMap.values().stream()
+                .filter(e -> !e.isSignedByArbitrator())
+                .filter(e -> Arrays.equals(e.getWitnessHash(), accountAgeWitness.getHash()))
+                .collect(Collectors.toSet());
+    }
+
+    // We go one level up by using the signer Key to lookup for SignedWitness objects which contain the signerKey as
+    // witnessOwnerPubKey
+    public Set<SignedWitness> getSignedWitnessSetBySignerPubKey(byte[] signerPubKey) {
+        return signedWitnessMap.values().stream()
+                .filter(e -> Arrays.equals(e.getWitnessOwnerPubKey(), signerPubKey))
+                .collect(Collectors.toSet());
+    }
+
+    public boolean isValidAccountAgeWitness(AccountAgeWitness accountAgeWitness) {

Hm... not sure if that can happen. Can you describe the case? If Alice signs Bob and Bob signs Carol and Carol signs Bob it is not an issue as the witness objects are the relevant objects which build the chain, not the signers. But in the lookup for the signers witness we need to probably use the date to use the oldest.

It also does not support yet handling of mulitple signers and when you are allowed to sign...

-- 
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/2768#discussion_r277809400
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bisq.network/pipermail/bisq-github/attachments/20190423/def53807/attachment.html>


More information about the bisq-github mailing list