From 432e0642ca3c11a087e743e184c75c5584b3df13 Mon Sep 17 00:00:00 2001 From: Craig Raw Date: Fri, 14 Apr 2023 07:50:06 -0600 Subject: [PATCH] cormorant: improve error message when core wallet support is disabled --- .../sparrow/net/cormorant/bitcoind/BitcoindClient.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/main/java/com/sparrowwallet/sparrow/net/cormorant/bitcoind/BitcoindClient.java b/src/main/java/com/sparrowwallet/sparrow/net/cormorant/bitcoind/BitcoindClient.java index dd785d0e..36ee0d39 100644 --- a/src/main/java/com/sparrowwallet/sparrow/net/cormorant/bitcoind/BitcoindClient.java +++ b/src/main/java/com/sparrowwallet/sparrow/net/cormorant/bitcoind/BitcoindClient.java @@ -125,6 +125,9 @@ public class BitcoindClient { } ListWalletDirResult listWalletDirResult = getBitcoindService().listWalletDir(); + if(listWalletDirResult == null) { + throw new RuntimeException("Wallet support must be enabled in Bitcoin Core"); + } boolean exists = listWalletDirResult.wallets().stream().anyMatch(walletDirResult -> walletDirResult.name().equals(CORE_WALLET_NAME)); legacyWalletExists = listWalletDirResult.wallets().stream().anyMatch(walletDirResult -> walletDirResult.name().equals(Bwt.DEFAULT_CORE_WALLET));