示例#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.");
             }
         }
     }
 }
示例#2
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;
                 }
             }
         }
     }
 }