mirror of
https://github.com/sparrowwallet/sparrow.git
synced 2024-12-25 13:16:44 +00:00
handle core bug where listwalletdir returns empty results
This commit is contained in:
parent
e01f6b42b1
commit
bebd7eebe5
1 changed files with 5 additions and 3 deletions
|
@ -141,11 +141,13 @@ public class BitcoindClient {
|
||||||
boolean exists = listWalletDirResult.wallets().stream().anyMatch(walletDirResult -> walletDirResult.name().equals(CORE_WALLET_NAME));
|
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));
|
legacyWalletExists = listWalletDirResult.wallets().stream().anyMatch(walletDirResult -> walletDirResult.name().equals(Bwt.DEFAULT_CORE_WALLET));
|
||||||
|
|
||||||
if(!exists) {
|
List<String> loadedWallets = getBitcoindService().listWallets();
|
||||||
|
boolean loaded = loadedWallets.contains(CORE_WALLET_NAME);
|
||||||
|
|
||||||
|
if(!exists && !loaded) {
|
||||||
getBitcoindService().createWallet(CORE_WALLET_NAME, true, true, "", true, true, true, false);
|
getBitcoindService().createWallet(CORE_WALLET_NAME, true, true, "", true, true, true, false);
|
||||||
} else {
|
} else {
|
||||||
List<String> wallets = getBitcoindService().listWallets();
|
if(!loaded) {
|
||||||
if(!wallets.contains(CORE_WALLET_NAME)) {
|
|
||||||
getBitcoindService().loadWallet(CORE_WALLET_NAME, true);
|
getBitcoindService().loadWallet(CORE_WALLET_NAME, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue