[bisq-network/bisq] Sign account usage (#2768)
sqrrm
notifications at github.com
Tue Apr 23 18:00:22 UTC 2019
sqrrm commented on this pull request.
Looks like a reasonable approach. Quite simple and not tying in to other parts.
> + addToMap((SignedWitness) payload);
+ });
+
+ // At startup the P2PDataStorage initializes earlier, otherwise we ge the listener called.
+ p2PService.getP2PDataStorage().getAppendOnlyDataStoreMap().values().forEach(e -> {
+ if (e instanceof SignedWitness)
+ addToMap((SignedWitness) e);
+ });
+ }
+
+
+ ///////////////////////////////////////////////////////////////////////////////////////////
+ // API
+ ///////////////////////////////////////////////////////////////////////////////////////////
+
+ // Arbitrators sign with EC key
Could you add a short explanation why arbitrators are using EC keys?
> + 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) {
There need to be a break in case of circular signing. If someone creates two witnesses that sign each other I think this recursion would go into an infinite loop.
--
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#pullrequestreview-229696928
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bisq.network/pipermail/bisq-github/attachments/20190423/8344fb2d/attachment.html>
More information about the bisq-github
mailing list