Exemplo n.º 1
0
        // This async getter is for clean exception handling
        private static async Task <PartialBlockChain> GetLocalPartialChainAsync()
        {
            if (_localPartialChain != null)
            {
                return(_localPartialChain);
            }

            _localPartialChain = new PartialBlockChain(Network, LocalSpvChain);
            try
            {
                await _localPartialChain.LoadAsync(_partialChainFolderPath).ConfigureAwait(false);
            }
            catch (Exception ex)
            {
                Console.WriteLine("Blockchain synchronisation is needed. Reason:");
                Console.WriteLine(ex.Message);
                _localPartialChain = new PartialBlockChain(Network, LocalSpvChain);
            }

            return(_localPartialChain);
        }
Exemplo n.º 2
0
 public MemPoolJob(NodesGroup nodes, PartialBlockChain chain)
 {
     _chain = chain;
     _nodes = nodes;
     State  = MemPoolState.NotStarted;
 }