public async Task <Miner> MineAsync(Address mineAddress, int?numberOfThreads, BlockHashed lastBlock, IEnumerable <TransactionSigned> transactions) { var miner = MinerFactory.Create(mineAddress, lastBlock, transactions, _feedback); var threadsClosure = numberOfThreads; await _feedback.Execute("Mine", () => MineAsync(miner, threadsClosure), () => $"{nameof(mineAddress)}: {mineAddress}, {nameof(numberOfThreads)}: {threadsClosure}"); return(miner); }
private void RemoveTasks(int taskCount) { _feedback.Execute("RemoveTasks", () => { var tasksToRemove = new List <MinerTask>(); for (var i = 0; i < taskCount; i++) { tasksToRemove.Add(_tasks.Dequeue()); } StopTasks(tasksToRemove); }, () => $"{nameof(taskCount)}: {taskCount}"); }