Ejemplo n.º 1
0
        public Checkpoint(string checkpointName, Network network, Stream data, CloudBlockBlob blob, ILoggerFactory loggerFactory)
        {
            this.loggerFactory = loggerFactory;
            this.logger        = loggerFactory.CreateLogger(GetType().FullName);

            if (checkpointName == null)
            {
                throw new ArgumentNullException("checkpointName");
            }
            _Blob           = blob;
            _CheckpointName = checkpointName;
            _BlockLocator   = new BlockLocator();
            if (data != null)
            {
                try
                {
                    _BlockLocator.ReadWrite(data, false);
                    return;
                }
                catch
                {
                }
            }
            var list = new List <uint256>();

            list.Add(network.GetGenesis().Header.GetHash());
            _BlockLocator = new BlockLocator();
            _BlockLocator.Blocks.AddRange(list);
        }
Ejemplo n.º 2
0
        public Checkpoint(string checkpointName, Network network, Stream data, CloudBlockBlob blob)
        {
            if (checkpointName == null)
            {
                throw new ArgumentNullException("checkpointName");
            }
            _Blob           = blob;
            _CheckpointName = checkpointName;
            _BlockLocator   = new BlockLocator();
            if (data != null)
            {
                try
                {
                    _BlockLocator.ReadWrite(data, false, network);
                    return;
                }
                catch
                {
                }
            }
            var list = new List <uint256>();

            list.Add(network.GetGenesis().Header.GetHash());
            _BlockLocator = new BlockLocator();
            _BlockLocator.Blocks.AddRange(list);
        }