public void DisconnectDisposeNullLocalNode() { if (LocalNode != null) { try { LocalNode?.Disconnect(); } catch (Exception ex) { Logger.LogDebug(ex); } finally { try { LocalNode?.Dispose(); } catch (Exception ex) { Logger.LogDebug(ex); } finally { LocalNode = null; Logger.LogInfo("Local Bitcoin node is disconnected."); } } } }
protected internal override void OnStop() { LocalNode.NewInventory -= LocalNode_NewInventory; Blockchain.Default.PersistCompleted -= Blockchain_PersistCompleted; localnode.Dispose(); Blockchain.Default.Dispose(); }
public static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new MainForm()); LocalNode.Dispose(); Blockchain.Default.Dispose(); }
protected internal override void OnStop() { source.Cancel(); while (!stopped) { Thread.Sleep(100); } localnode.Dispose(); Blockchain.Default.Dispose(); }
public static void DisconnectDisposeNullLocalNode() { if (LocalNode != null) { try { LocalNode?.Disconnect(); } catch (Exception ex) { Logger.LogDebug <WalletService>(ex); } finally { try { LocalNode?.Dispose(); } catch (Exception ex) { Logger.LogDebug <WalletService>(ex); } finally { LocalNode = null; try { Logger.LogInfo <WalletService>("Local Bitcoin Node is disconnected."); } catch (Exception) { throw; } } } } }
/// <summary> /// Stops and disposes of resources. Dispose() calls this method /// </summary> public void Stop() { _logger.LogMessage("Shutting Down"); LocalNode?.Dispose(); _blockchain?.Dispose(); }