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

<hr>

<p>In <a href="https://github.com/bisq-network/bisq/pull/4299#discussion_r440914868">core/src/main/java/bisq/core/grpc/CoreWalletsService.java</a>:</p>
<pre style='color:#555'>> @@ -50,6 +75,68 @@ public long getAvailableBalance() {
         return balance.getValue();
     }
 
+    public long getAddressBalance(String addressString) {
+        Address address = getAddressEntry(addressString).getAddress();
+        return btcWalletService.getBalanceForAddress(address).value;
+    }
+
+    public String getFundingAddresses() {
+        if (!walletsManager.areWalletsAvailable())
+            throw new IllegalStateException("wallet is not yet available");
+
+        if (walletsManager.areWalletsEncrypted() && tempAesKey == null)
+            throw new IllegalStateException("wallet is locked");
</pre>
<p>What I see as a reusable and complex unit is not the predicate, but the pair of a predicate and the throwing of the exception. For example, checking if a wallet is locked and, if so, throwing an exception saying that it is locked. So the method I'm suggesting  would look like this:</p>
<pre><code>private void aGoodName() {
  if (walletsManager.areWalletsEncrypted() && tempAesKey == null
    throw new IllegalStateException("wallet is locked");
}
</code></pre>
<p>Does that make sense?</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/4299#discussion_r440914868">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AJFFTNXSC45SAA2JHV4GQOTRW6BS3ANCNFSM4N5F3SAQ">unsubscribe</a>.<img src="https://github.com/notifications/beacon/AJFFTNUF6B6T3N3C7ORTBOTRW6BS3A5CNFSM4N5F3SA2YY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGODG4Y27I.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/4299#discussion_r440914868",
"url": "https://github.com/bisq-network/bisq/pull/4299#discussion_r440914868",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>