Exemple #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.");
             }
         }
     }
 }
Exemple #2
0
 protected internal override void OnStop()
 {
     LocalNode.NewInventory -= LocalNode_NewInventory;
     Blockchain.Default.PersistCompleted -= Blockchain_PersistCompleted;
     localnode.Dispose();
     Blockchain.Default.Dispose();
 }
Exemple #3
0
 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();
 }
Exemple #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;
                 }
             }
         }
     }
 }
Exemple #6
0
 /// <summary>
 ///     Stops and disposes of resources. Dispose() calls this method
 /// </summary>
 public void Stop()
 {
     _logger.LogMessage("Shutting Down");
     LocalNode?.Dispose();
     _blockchain?.Dispose();
 }