Source:
public void onDestroy() { log.debug(".onDestroy()"); WalletApplication.scheduleStartBlockchainService(this); unregisterReceiver(tickReceiver); application.getWallet().removeChangeEventListener(walletEventListener); application.getWallet().removeCoinsSentEventListener(walletEventListener); application.getWallet().removeCoinsReceivedEventListener(walletEventListener); application.getWallet().getContext().sporkManager.removeEventListener(sporkUpdatedEventListener); unregisterReceiver(connectivityReceiver); if (peerGroup != null) { peerGroup.removeDisconnectedEventListener(peerConnectivityListener); peerGroup.removeConnectedEventListener(peerConnectivityListener); peerGroup.removeWallet(application.getWallet()); peerGroup.stop(); log.info("peergroup stopped"); } peerConnectivityListener.stop(); delayHandler.removeCallbacksAndMessages(null); try { blockStore.close(); } catch (final BlockStoreException x) { throw new RuntimeException(x); } if (!deleteWalletFileOnShutdown) { application.saveWallet(); } if (wakeLock.isHeld()) { log.debug("wakelock still held, releasing"); wakeLock.release(); } if (resetBlockchainOnShutdown || deleteWalletFileOnShutdown) { log.info("removing blockchain"); blockChainFile.delete(); SimplifiedMasternodeListManager manager = application.getWallet().getContext().masternodeListManager; if(manager != null) { manager.resetMNList(true, false); } if (deleteWalletFileOnShutdown) { log.info("removing wallet file and app data"); application.finalizeWipe(); } } if(bootStrapStream != null) { try { bootStrapStream.close(); } catch (IOException x) { } } super.onDestroy(); log.info("service was up for " + ((System.currentTimeMillis() - serviceCreatedAt) / 1000 / 60) + " minutes"); }

Target:
public void onDestroy() { log.debug(".onDestroy()"); WalletApplication.scheduleStartBlockchainService(this); unregisterReceiver(tickReceiver); application.getWallet().removeChangeEventListener(walletEventListener); application.getWallet().removeCoinsSentEventListener(walletEventListener); application.getWallet().removeCoinsReceivedEventListener(walletEventListener); unregisterReceiver(connectivityReceiver); if (peerGroup != null) { peerGroup.removeDisconnectedEventListener(peerConnectivityListener); peerGroup.removeConnectedEventListener(peerConnectivityListener); peerGroup.removeWallet(application.getWallet()); peerGroup.stop(); log.info("peergroup stopped"); } peerConnectivityListener.stop(); delayHandler.removeCallbacksAndMessages(null); try { blockStore.close(); } catch (final BlockStoreException x) { throw new RuntimeException(x); } if (!deleteWalletFileOnShutdown) { application.saveWallet(); } if (wakeLock.isHeld()) { log.debug("wakelock still held, releasing"); wakeLock.release(); } if (resetBlockchainOnShutdown || deleteWalletFileOnShutdown) { log.info("removing blockchain"); blockChainFile.delete(); SimplifiedMasternodeListManager manager = application.getWallet().getContext().masternodeListManager; if(manager != null) { manager.resetMNList(true, false); } if (deleteWalletFileOnShutdown) { log.info("removing wallet file and app data"); application.finalizeWipe(); } } if(bootStrapStream != null) { try { bootStrapStream.close(); } catch (IOException x) { } } super.onDestroy(); log.info("service was up for " + ((System.currentTimeMillis() - serviceCreatedAt) / 1000 / 60) + " minutes"); }