Ejemplo n.º 1
0
 private void OnStart(Start options)
 {
     Log("OnStart");
     started = true;
     if (!options.IgnoreRecoveryLogs && context.Load())
     {
         if (context.Transactions != null)
         {
             Sender.Ask <Blockchain.FillCompleted>(new Blockchain.FillMemoryPool
             {
                 Transactions = context.Transactions.Values
             }).Wait();
         }
         if (context.CommitSent())
         {
             CheckPreparations();
             return;
         }
     }
     InitializeConsensus(0);
     // Issue a ChangeView with NewViewNumber of 0 to request recovery messages on start-up.
     if (context.BlockIndex == Blockchain.Singleton.HeaderHeight + 1)
     {
         localNode.Tell(new LocalNode.SendDirectly {
             Inventory = context.MakeChangeView(0)
         });
     }
 }