Пример #1
0
 internal void StopStaking()
 {
     if (this.stakingService != null)
     {
         this.stakingService.Stop();
         this.stakingService = null;
     }
 }
Пример #2
0
 public WorkPuller(IAppConfiguration appConfiguration, BlockTemplateCache blockTemplateCache, StakingService stakingService, MinerCoordinator minerCoordinator, DeviceController deviceController, RPCClient rpcClient, ILoggerFactory loggerFactory)
 {
     this.appConfiguration   = appConfiguration;
     this.blockTemplateCache = blockTemplateCache;
     this.stakingService     = stakingService;
     this.minerCoordinator   = minerCoordinator;
     this.deviceController   = deviceController;
     this.rpcClient          = rpcClient;
     this.logger             = loggerFactory.CreateLogger <WorkPuller>();
     this.stopwatch          = new Stopwatch();
 }
Пример #3
0
        public void StartStaking(string passphrase)
        {
            if (this.isDisposing)
            {
                return;
            }

            Guard.NotNull(passphrase, nameof(passphrase));

            if (VCL.DecryptWithPassphrase(passphrase, base.GetPassphraseChallenge()) == null)
            {
                throw new X1WalletException(HttpStatusCode.Unauthorized, "The passphrase is not correct.");
            }

            base.SetStakingPassphrase(passphrase);


            if (this.stakingService == null)
            {
                this.stakingService = new StakingService(this, passphrase, this.nodeServices);
                this.stakingService.Start();
            }
        }