public async Task MineWithTxHubAsync() { var txCount = 0; var preBlockHash = _chain.BestChainHash; var preBlockHeight = _chain.BestChainHeight; while (txCount < TransactionCount) { var blockExecutedSet = await _minerService.MineAsync(preBlockHash, preBlockHeight, TimestampHelper.GetUtcNow(), TimestampHelper.DurationFromMilliseconds(4000)); txCount += blockExecutedSet.TransactionIds.Count(); _transactionIdList.AddRange(blockExecutedSet.TransactionIds.ToList()); await BlockchainService.SetBestChainAsync(_chain, preBlockHeight, preBlockHash); await TransactionPoolService.CleanByTransactionIdsAsync(blockExecutedSet.TransactionIds); await TransactionPoolService.UpdateTransactionPoolByBestChainAsync(preBlockHash, preBlockHeight); } }