private async Task GetTransactionPositionsBySingleAddress(string paymentAddress, SortedSet <Tuple <Int64, string> > txPositions, Stopwatch stopWatch) { Utils.CheckIfChainIsFresh(chain_, config_.AcceptStaleRequests); using (var address = new PaymentAddress(paymentAddress)) { //Unconfirmed first GetUnconfirmedTransactionPositions(address, txPositions); //3 statsGetTransactions.Add(stopWatch.ElapsedMilliseconds); using (var getTransactionResult = await chain_.FetchConfirmedTransactionsAsync(address, UInt64.MaxValue, 0)) { Utils.CheckBitprimApiErrorCode(getTransactionResult.ErrorCode, "FetchConfirmedTransactionsAsync(" + paymentAddress + ") failed, check error log."); //4 statsGetTransactions.Add(stopWatch.ElapsedMilliseconds); INativeList <byte[]> confirmedTxIds = getTransactionResult.Result; //Confirmed foreach (byte[] txHash in confirmedTxIds) { ApiCallResult <GetTxPositionResult> getTxPosResult = await chain_.FetchTransactionPositionAsync(txHash, true); string txHashStr = Binary.ByteArrayToHexString(txHash); Utils.CheckBitprimApiErrorCode(getTxPosResult.ErrorCode, "FetchTransactionPositionAsync(" + txHashStr + ") failed, check error log"); txPositions.Add(new Tuple <Int64, string>((Int64)getTxPosResult.Result.BlockHeight, txHashStr)); } //5 statsGetTransactions.Add(stopWatch.ElapsedMilliseconds); } } }