public void shutdown () throws BlockStoreException { peerGroup.stop(); blockStore.close(); }
private static void shutdown() { try { if (peers == null) return; // setup() never called so nothing to do. if (peers.isRunning()) peers.stop(); saveWallet(walletFile); store.close(); wallet = null; } catch (BlockStoreException e) { throw new RuntimeException(e); } }
@Override protected void shutDown() throws Exception { // Runs in a separate thread. try { Context.propagate(context); vPeerGroup.stop(); vWallet.saveToFile(vWalletFile); vStore.close(); vPeerGroup = null; vWallet = null; vStore = null; vChain = null; } catch (BlockStoreException e) { throw new IOException(e); } }
@Override protected void shutDown() throws Exception { // Runs in a separate thread. try { Context.propagate(context); vPeerGroup.stop(); vWallet.saveToFile(vWalletFile); vStore.close(); vPeerGroup = null; vWallet = null; vStore = null; vChain = null; } catch (BlockStoreException e) { throw new IOException(e); } }
@Override protected void shutDown() throws Exception { // Runs in a separate thread. try { Context.propagate(context); vPeerGroup.stop(); vWallet.saveToFile(vWalletFile); vStore.close(); vPeerGroup = null; vWallet = null; vStore = null; vChain = null; } catch (BlockStoreException e) { throw new IOException(e); } }
@Override protected void shutDown() throws Exception { // Runs in a separate thread. try { Context.propagate(context); vPeerGroup.stop(); vWallet.saveToFile(vWalletFile); vStore.close(); vPeerGroup = null; vWallet = null; vStore = null; vChain = null; } catch (BlockStoreException e) { throw new IOException(e); } }
/** * Removes the current wallet from the block chain and closes the block store */ private void closeBlockstore() { // Remove the wallet from the block chain before closing the blockstore if (WalletManager.INSTANCE.getCurrentWalletSummary().isPresent() && blockChain != null) { log.debug("Removing wallet from blockChain..."); blockChain.removeWallet(WalletManager.INSTANCE.getCurrentWalletSummary().get().getWallet()); blockChain = null; // need to recreate it when a new blockstore is created } // Close the blockstore if (blockStore != null) { try { // The blockstore can throw an NPE internally log.debug("When the blockstore was closed the height was {}", blockStore.getChainHead() == null ? "unknown" : blockStore.getChainHead().getHeight()); blockStore.close(); } catch (BlockStoreException e) { log.warn("BlockStoreException: Blockstore was already closed or not closed cleanly: {}", e.getMessage()); } catch (NullPointerException e) { // Internal bug in Bitcoinj } } else { log.debug("blockStore was not present"); } blockStore = null; }
blockStore.close(); } catch (BlockStoreException bse) { log.warn("Failed to close block store", bse);
if (chainFileExists) { log.info("Deleting the chain file in preparation from restore."); vStore.close(); if (!chainFile.delete()) throw new IOException("Failed to delete chain file in preparation for restore."); } else if (chainFileExists) { log.info("Deleting the chain file in preparation from restore."); vStore.close(); if (!chainFile.delete()) throw new IOException("Failed to delete chain file in preparation for restore.");
if (chainFileExists) { log.info("Deleting the chain file in preparation from restore."); vStore.close(); if (!chainFile.delete()) throw new IOException("Failed to delete chain file in preparation for restore."); } else if (chainFileExists) { log.info("Deleting the chain file in preparation from restore."); vStore.close(); if (!chainFile.delete()) throw new IOException("Failed to delete chain file in preparation for restore.");
if (chainFileExists) { log.info("Deleting the chain file in preparation from restore."); vStore.close(); if (!chainFile.delete()) throw new IOException("Failed to delete chain file in preparation for restore."); } else if (chainFileExists) { log.info("Deleting the chain file in preparation from restore."); vStore.close(); if (!chainFile.delete()) throw new IOException("Failed to delete chain file in preparation for restore.");
if (chainFileExists) { log.info("Deleting the chain file in preparation from restore."); vStore.close(); if (!chainFile.delete()) throw new IOException("Failed to delete chain file in preparation for restore."); } else if (chainFileExists) { log.info("Deleting the chain file in preparation from restore."); vStore.close(); if (!chainFile.delete()) throw new IOException("Failed to delete chain file in preparation for restore.");
store.close();