mirror of
https://github.com/sparrowwallet/sparrow.git
synced 2024-12-25 05:06:45 +00:00
reload cormorant wallet if unloaded when polling bitcoind
This commit is contained in:
parent
ee6589991d
commit
dbafefb940
1 changed files with 10 additions and 1 deletions
|
@ -157,7 +157,16 @@ public class BitcoindClient {
|
||||||
}
|
}
|
||||||
|
|
||||||
private ListSinceBlock getListSinceBlock(String blockHash) {
|
private ListSinceBlock getListSinceBlock(String blockHash) {
|
||||||
return getBitcoindService().listSinceBlock(blockHash, 1, true, true, true);
|
try {
|
||||||
|
return getBitcoindService().listSinceBlock(blockHash, 1, true, true, true);
|
||||||
|
} catch(JsonRpcException e) {
|
||||||
|
if(e.getErrorMessage() != null && e.getErrorMessage().getMessage() != null && e.getErrorMessage().getMessage().contains("is not loaded")) {
|
||||||
|
getBitcoindService().loadWallet(CORE_WALLET_NAME, true);
|
||||||
|
return getBitcoindService().listSinceBlock(blockHash, 1, true, true, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
throw e;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void importWallets(Collection<Wallet> wallets) throws ImportFailedException {
|
public void importWallets(Collection<Wallet> wallets) throws ImportFailedException {
|
||||||
|
|
Loading…
Reference in a new issue