internal void StopStaking() { if (this.stakingService != null) { this.stakingService.Stop(); this.stakingService = null; } }
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(); }
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(); } }