[bisq-network/bisq] [WIP] Backup, restore and create a new onion address via GUI (#3044)

Florian Reimair notifications at github.com
Tue Aug 20 11:18:29 UTC 2019

freimair commented on this pull request.

>              openOffer.setState(OpenOffer.State.CLOSED);
                     () -> log.trace("Successful removed offer"),
+    private void removeFromOpenOffers(OpenOffer offer) {
+        openOffers.remove(offer);
+        // extract my node address
+        NodeAddress myNodeAddress = offer.getOffer().getOfferPayload().getOwnerNodeAddress();
+        // check
+        if(openOffers.stream().noneMatch(openOffer -> openOffer.getOffer().getOfferPayload().getOwnerNodeAddress().equals(myNodeAddress))) {
+            // check ongoing trades
+            if(tradeManager.getTradableList().stream().noneMatch(trade -> trade.getContract().getBuyerNodeAddress().equals(myNodeAddress) || trade.getContract().getSellerNodeAddress().equals(myNodeAddress)))
+                        p2PService.reportUnusedNodeAddress(myNodeAddress);

ad missing role check: well, it is not that easy to determine what the clients role is at that point. Your code suggestion only works for trades you created. It fails if you took an offer from someone else. If one is doing the check thoroughly, it is much more complex, also because necessary info may not be provided (null) in certain cases. The approach now is to add any and all onion addresses that are anywhere related to the cause and prevent them from being deleted. Plus, even if a HS is wrongly kept once, it may be released in the future without any further calls and checks and complexity in the code.

ad null-check: fixed.

ad rename: I haven't touched the names as there is no Javadoc that explains what is what.

You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bisq.network/pipermail/bisq-github/attachments/20190820/05e11bcc/attachment.html>

More information about the bisq-github mailing list