[bisq-network/bisq] Add rpc method 'getfundingaddresses' (#4299)

dmos62 notifications at github.com
Tue Jun 16 14:54:37 UTC 2020


@dmos62 commented on this pull request.



> @@ -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");

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:
```
private void aGoodName() {
  if (walletsManager.areWalletsEncrypted() && tempAesKey == null
    throw new IllegalStateException("wallet is locked");
}
```

Does that make sense?

-- 
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/4299#discussion_r440914868
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bisq.network/pipermail/bisq-github/attachments/20200616/b5984846/attachment.html>


More information about the bisq-github mailing list