예제 #1
0
 public async Task Start()
 {
     _running    = true;
     _scanHeight = _db.GetMaxSyncIndex() ?? 0;
     while (_running)
     {
         try
         {
             if (await Sync(_scanHeight))
             {
                 _scanHeight++;
             }
             if (_scanHeight > Blockchain.Singleton.Height)
             {
                 await Task.Delay(TimeSpan.FromSeconds(5));
             }
         }
         catch (Exception e)
         {
             Console.WriteLine(e);
             throw;
         }
     }
 }
예제 #2
0
 public async Task <object> GetSync()
 {
     using var db = new TrackDB();
     return(db.GetMaxSyncIndex());
 }