Ejemplo n.º 1
0
 public virtual void Disconnect(bool error)
 {
     if (Interlocked.Exchange(ref disposed, 1) == 0)
     {
         Disconnected?.Invoke(this, error);
         bool needSync = false;
         lock (missions_global)
             lock (missions)
                 if (missions.Count > 0)
                 {
                     missions_global.ExceptWith(missions);
                     needSync = true;
                 }
         if (needSync)
         {
             localNode.RequestGetBlocks();
         }
     }
 }
Ejemplo n.º 2
0
 public virtual void Disconnect(bool error)
 {
     TR.Enter();
     if (Interlocked.Exchange(ref disposed, 1) == 0)
     {
         Disconnected?.Invoke(this, error);
         bool needSync = false;
         lock (missions_global)
             lock (missions)
                 if (missions.Count > 0)
                 {
                     foreach (UInt256 hash in missions)
                     {
                         missions_global.Remove(hash);
                     }
                     needSync = true;
                 }
         if (needSync)
         {
             localNode.RequestGetBlocks();
         }
     }
     TR.Exit();
 }