Esempio n. 1
0
 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.");
             }
         }
     }
 }
Esempio n. 2
0
 protected internal override void OnStop()
 {
     LocalNode.NewInventory -= LocalNode_NewInventory;
     Blockchain.Default.PersistCompleted -= Blockchain_PersistCompleted;
     localnode.Dispose();
     Blockchain.Default.Dispose();
 }
Esempio n. 3
0
 public static void Main()
 {
     Application.EnableVisualStyles();
     Application.SetCompatibleTextRenderingDefault(false);
     Application.Run(new MainForm());
     LocalNode.Dispose();
     Blockchain.Default.Dispose();
 }
Esempio n. 4
0
 protected internal override void OnStop()
 {
     source.Cancel();
     while (!stopped)
     {
         Thread.Sleep(100);
     }
     localnode.Dispose();
     Blockchain.Default.Dispose();
 }
Esempio n. 5
0
 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;
                 }
             }
         }
     }
 }
Esempio n. 6
0
 /// <summary>
 ///     Stops and disposes of resources. Dispose() calls this method
 /// </summary>
 public void Stop()
 {
     _logger.LogMessage("Shutting Down");
     LocalNode?.Dispose();
     _blockchain?.Dispose();
 }