<p><b>@freimair</b> commented on this pull request.</p>

<hr>

<p>In <a href="https://github.com/bisq-network/bisq/pull/3044#discussion_r315634179">core/src/main/java/bisq/core/offer/OpenOfferManager.java</a>:</p>
<pre style='color:#555'>>              openOffer.setState(OpenOffer.State.CLOSED);
             offerBookService.removeOffer(openOffer.getOffer().getOfferPayload(),
                     () -> log.trace("Successful removed offer"),
                     log::error);
         });
     }
 
+    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);
</pre>
<p>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.</p>
<p>ad null-check: fixed.</p>
<p>ad rename: I haven't touched the names as there is no Javadoc that explains what is what.</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/bisq-network/bisq/pull/3044?email_source=notifications&email_token=AJFFTNUDBOQZQKDTQ2B2GW3QFPHILA5CNFSM4IIPXYQ2YY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOCCCCDTA#discussion_r315634179">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AJFFTNRH3NLDDAWQQ6LIEGTQFPHILANCNFSM4IIPXYQQ">mute the thread</a>.<img src="https://github.com/notifications/beacon/AJFFTNSWDBQT6EEDHT6RVYTQFPHILA5CNFSM4IIPXYQ2YY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOCCCCDTA.gif" height="1" width="1" alt="" /></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/bisq-network/bisq/pull/3044?email_source=notifications\u0026email_token=AJFFTNUDBOQZQKDTQ2B2GW3QFPHILA5CNFSM4IIPXYQ2YY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOCCCCDTA#discussion_r315634179",
"url": "https://github.com/bisq-network/bisq/pull/3044?email_source=notifications\u0026email_token=AJFFTNUDBOQZQKDTQ2B2GW3QFPHILA5CNFSM4IIPXYQ2YY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOCCCCDTA#discussion_r315634179",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>