[bisq-network/bisq] Refactor capabilities and other P2P-related stuff (#2469)
Florian Reimair
notifications at github.com
Thu Mar 7 11:19:27 UTC 2019
freimair commented on this pull request.
> } else {
- return msg instanceof CapabilityRequiringPayload && sharedModel.isCapabilitySupported(((CapabilityRequiringPayload) msg).getRequiredCapabilities());
+ return true;
I thought about changing stuff around but it quickly gets dirty.
Most beautiful would be that we do not need the method at all but instead can use a `connection.isCapabilitySupported(msg)` or `isCapabilitySupported(msg)` directly. However, the class hierarchy has grown overly complicated over time and such a solution is not possible as things stand now (would result in a diamond pattern if Java would allow for that).
Even looks worse if depicted like that:
![messages](https://user-images.githubusercontent.com/1070734/53952939-6eef5800-40d2-11e9-8ca4-1059082d07d9.png)
I even tried to use java8/9 defaults in interfaces and create some sort of mixins. Nasty stuff. Definitely needs cleanup! Small steps...
--
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/2469#discussion_r263339306
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bisq.network/pipermail/bisq-github/attachments/20190307/ec67304a/attachment.html>
More information about the bisq-github
mailing list