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

Manfred Karrer notifications at github.com
Tue Aug 20 11:25:14 UTC 2019

ManfredKarrer 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);

Ah, yes you are right, OpenOfferManager handles it differently than tradeManager. But for OpenOffers my suggestion is correct as you are the maker. But for trades we need to use the pubKey to detect which role is ours. A util method in Contract ight be good as that is used anyway at other pleces as well (arbitration as far I remember).

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/d6beb0f9/attachment-0001.html>

More information about the bisq-github mailing list